diff options
-rw-r--r-- | sys/alpha/alpha/pmap.c | 27 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 30 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 30 | ||||
-rw-r--r-- | sys/ia64/ia64/pmap.c | 30 |
4 files changed, 43 insertions, 74 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 9444869..39cd851 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -186,8 +186,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_DIAGNOSTIC #endif -#define MINPV 2048 - #if 0 #define PMAP_DIAGNOSTIC #define PMAP_DEBUG @@ -572,28 +570,24 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { + int shpgperproc = PMAP_SHPGPERPROC; /* - * init the pv free list + * Initialize the address space (zone) for the pv entries. Set a + * high water mark so that the system can recover from excessive + * numbers of pv entries. */ - pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, + pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_prealloc(pvzone, MINPV); + TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); + pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); } -/* - * Initialize the address space (zone) for the pv_entries. Set a - * high water mark so that the system can recover from excessive - * numbers of pv entries. - */ void pmap_init2() { - int shpgperproc = PMAP_SHPGPERPROC; - - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + vm_page_array_size; - pv_entry_high_water = 9 * (pv_entry_max / 10); } @@ -1313,8 +1307,7 @@ static pv_entry_t get_pv_entry(void) { pv_entry_count++; - if (pv_entry_high_water && - (pv_entry_count > pv_entry_high_water) && + if ((pv_entry_count > pv_entry_high_water) && (pmap_pagedaemon_waken == 0)) { pmap_pagedaemon_waken = 1; wakeup (&vm_pages_needed); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 7fa7d8e..d144849 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -152,8 +152,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_DIAGNOSTIC #endif -#define MINPV 2048 - #if !defined(PMAP_DIAGNOSTIC) #define PMAP_INLINE __inline #else @@ -567,30 +565,25 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { + int shpgperproc = PMAP_SHPGPERPROC; /* - * init the pv free list + * Initialize the address space (zone) for the pv entries. Set a + * high water mark so that the system can recover from excessive + * numbers of pv entries. */ - pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, + pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_prealloc(pvzone, MINPV); + TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); + pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); } -/* - * Initialize the address space (zone) for the pv_entries. Set a - * high water mark so that the system can recover from excessive - * numbers of pv entries. - */ void pmap_init2() { - int shpgperproc = PMAP_SHPGPERPROC; - - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + vm_page_array_size; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); - pv_entry_high_water = 9 * (pv_entry_max / 10); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); } @@ -1442,8 +1435,7 @@ static pv_entry_t get_pv_entry(void) { pv_entry_count++; - if (pv_entry_high_water && - (pv_entry_count > pv_entry_high_water) && + if ((pv_entry_count > pv_entry_high_water) && (pmap_pagedaemon_waken == 0)) { pmap_pagedaemon_waken = 1; wakeup (&vm_pages_needed); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index b9f852f..0f0f3ad 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -156,8 +156,6 @@ __FBSDID("$FreeBSD$"); #define PMAP_DIAGNOSTIC #endif -#define MINPV 2048 - #if !defined(PMAP_DIAGNOSTIC) #define PMAP_INLINE __inline #else @@ -473,13 +471,20 @@ pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) void pmap_init(void) { + int shpgperproc = PMAP_SHPGPERPROC; /* - * init the pv free list + * Initialize the address space (zone) for the pv entries. Set a + * high water mark so that the system can recover from excessive + * numbers of pv entries. */ - pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, + pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_prealloc(pvzone, MINPV); + TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); + pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); #ifdef PAE pdptzone = uma_zcreate("PDPT", NPGPTD * sizeof(pdpt_entry_t), NULL, @@ -489,21 +494,9 @@ pmap_init(void) #endif } -/* - * Initialize the address space (zone) for the pv_entries. Set a - * high water mark so that the system can recover from excessive - * numbers of pv entries. - */ void pmap_init2() { - int shpgperproc = PMAP_SHPGPERPROC; - - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + vm_page_array_size; - TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); - pv_entry_high_water = 9 * (pv_entry_max / 10); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); } @@ -1444,8 +1437,7 @@ static pv_entry_t get_pv_entry(void) { pv_entry_count++; - if (pv_entry_high_water && - (pv_entry_count > pv_entry_high_water) && + if ((pv_entry_count > pv_entry_high_water) && (pmap_pagedaemon_waken == 0)) { pmap_pagedaemon_waken = 1; wakeup (&vm_pages_needed); diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index 6a094e8..a21cead 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -124,8 +124,6 @@ MALLOC_DEFINE(M_PMAP, "PMAP", "PMAP Structures"); #define PMAP_SHPGPERPROC 200 #endif -#define MINPV 2048 /* Preallocate at least this many */ - #if !defined(DIAGNOSTIC) #define PMAP_INLINE __inline #else @@ -518,32 +516,27 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { + int shpgperproc = PMAP_SHPGPERPROC; /* - * Init the pv free list and the PTE free list. + * Initialize the address space (zone) for the pv entries. Set a + * high water mark so that the system can recover from excessive + * numbers of pv entries. */ - pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); - uma_prealloc(pvzone, MINPV); + pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL, + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); + pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; + TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); ptezone = uma_zcreate("PT ENTRY", sizeof (struct ia64_lpte), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE); - uma_prealloc(ptezone, MINPV); } -/* - * Initialize the address space (zone) for the pv_entries. Set a - * high water mark so that the system can recover from excessive - * numbers of pv entries. - */ void pmap_init2() { - int shpgperproc = PMAP_SHPGPERPROC; - - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + vm_page_array_size; - pv_entry_high_water = 9 * (pv_entry_max / 10); } @@ -821,8 +814,7 @@ static pv_entry_t get_pv_entry(void) { pv_entry_count++; - if (pv_entry_high_water && - (pv_entry_count > pv_entry_high_water) && + if ((pv_entry_count > pv_entry_high_water) && (pmap_pagedaemon_waken == 0)) { pmap_pagedaemon_waken = 1; wakeup (&vm_pages_needed); |