diff options
author | alc <alc@FreeBSD.org> | 2005-11-04 18:03:24 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2005-11-04 18:03:24 +0000 |
commit | 796bccfcadfd447810b149674435ab160df877fa (patch) | |
tree | 16825cb17ac6d650e86cd9bb32afb538212af9d0 /sys/ia64 | |
parent | 438cb7bde701ce0b9a4dffe748bd0f98a9621770 (diff) | |
download | FreeBSD-src-796bccfcadfd447810b149674435ab160df877fa.zip FreeBSD-src-796bccfcadfd447810b149674435ab160df877fa.tar.gz |
Begin and end the initialization of pvzone in pmap_init().
Previously, pvzone's initialization was split between pmap_init() and
pmap_init2(). This split initialization was the underlying cause of
some UMA panics during initialization. Specifically, if the UMA boot
pages was exhausted before the pvzone was fully initialized, then UMA,
through no fault of its own, would use an inappropriate back-end
allocator leading to a panic. (Previously, as a workaround, we have
increased the UMA boot pages.) Fortunately, there is no longer any
reason that pvzone's initialization cannot be completed in
pmap_init().
Eliminate a check for whether pv_entry_high_water has been initialized
or not from get_pv_entry(). Since pvzone's initialization is
completed in pmap_init(), this check is no longer needed.
Use cnt.v_page_count, the actual count of available physical pages,
instead of vm_page_array_size to compute the maximum number of pv
entries.
Introduce the vm.pmap.pv_entries tunable on alpha and ia64.
Eliminate some unnecessary white space.
Discussed with: tegge (item #1)
Tested by: marcel (ia64)
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/pmap.c | 30 |
1 files changed, 11 insertions, 19 deletions
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); |