From 83f108b04dd3280195b5f0cf6bc2af10630e5f75 Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 14 Jun 2003 23:23:55 +0000 Subject: Migrate the thread stack management functions from the machine-dependent to the machine-independent parts of the VM. At the same time, this introduces vm object locking for the non-i386 platforms. Two details: 1. KSTACK_GUARD has been removed in favor of KSTACK_GUARD_PAGES. The different machine-dependent implementations used various combinations of KSTACK_GUARD and KSTACK_GUARD_PAGES. To disable guard page, set KSTACK_GUARD_PAGES to 0. 2. Remove the (unnecessary) clearing of PG_ZERO in vm_thread_new. In 5.x, (but not 4.x,) PG_ZERO can only be set if VM_ALLOC_ZERO is passed to vm_page_alloc() or vm_page_grab(). --- sys/ia64/ia64/pmap.c | 47 ----------------------------------------------- sys/ia64/include/param.h | 1 + 2 files changed, 1 insertion(+), 47 deletions(-) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index dd6ba1d..77effaa 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -765,53 +765,6 @@ pmap_track_modified(vm_offset_t va) return 0; } -/* - * Create the KSTACK for a new thread. - * This routine directly affects the fork perf for a process/thread. - */ -void -pmap_new_thread(struct thread *td, int pages) -{ - - /* Bounds check */ - if (pages <= 1) - pages = KSTACK_PAGES; - else if (pages > KSTACK_MAX_PAGES) - pages = KSTACK_MAX_PAGES; - td->td_kstack = (vm_offset_t)malloc(pages * PAGE_SIZE, M_PMAP, - M_WAITOK); - td->td_kstack_pages = pages; -} - -/* - * Dispose the KSTACK for a thread that has exited. - * This routine directly impacts the exit perf of a process/thread. - */ -void -pmap_dispose_thread(struct thread *td) -{ - - free((void*)td->td_kstack, M_PMAP); - td->td_kstack = 0; - td->td_kstack_pages = 0; -} - -/* - * Allow the KSTACK for a thread to be prejudicially paged out. - */ -void -pmap_swapout_thread(struct thread *td) -{ -} - -/* - * Bring the KSTACK for a specified thread back in. - */ -void -pmap_swapin_thread(struct thread *td) -{ -} - /*************************************************** * Page table page management routines..... ***************************************************/ diff --git a/sys/ia64/include/param.h b/sys/ia64/include/param.h index 2548fa6..1b3bf0c 100644 --- a/sys/ia64/include/param.h +++ b/sys/ia64/include/param.h @@ -135,6 +135,7 @@ #define SINCR 1 /* increment of stack/NBPG */ #define KSTACK_PAGES 4 /* pages of kernel stack */ +#define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ #define UAREA_PAGES 1 /* pages of u-area */ /* -- cgit v1.1