From 0b27d7104fda7773d97cedf88414f80a43bdb6e4 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Fri, 27 Jul 2001 01:08:59 +0000 Subject: [PATCH] Make PMAP_SHPGPERPROC tunable. One shouldn't need to recompile a kernel for this, since it is easy to run into with large systems with lots of shared mmap space. Obtained from: yahoo --- sys/alpha/alpha/pmap.c | 6 +++++- sys/amd64/amd64/pmap.c | 6 +++++- sys/i386/i386/pmap.c | 6 +++++- sys/ia64/ia64/pmap.c | 5 ++++- sys/powerpc/aim/mmu_oea.c | 6 +++++- sys/powerpc/powerpc/mmu_oea.c | 6 +++++- sys/powerpc/powerpc/pmap.c | 6 +++++- 7 files changed, 34 insertions(+), 7 deletions(-) diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 43f65e34ed82..7f2a6e887411 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -150,6 +150,7 @@ #include #include +#include #include #include #include @@ -639,7 +640,10 @@ pmap_init(phys_start, phys_end) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index a00bcab2a4f2..f2d447f1bb42 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -74,6 +74,7 @@ #include #include +#include #include #include #include @@ -504,7 +505,10 @@ pmap_init(phys_start, phys_end) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index a00bcab2a4f2..f2d447f1bb42 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -74,6 +74,7 @@ #include #include +#include #include #include #include @@ -504,7 +505,10 @@ pmap_init(phys_start, phys_end) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index a9619df84358..d5f4bbd7dc2e 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -377,7 +377,10 @@ pmap_init(phys_start, phys_end) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index b7f2d05e3621..cc28d4b7f96c 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -1639,7 +1640,10 @@ pmap_growkernel(vm_offset_t addr) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/powerpc/powerpc/mmu_oea.c b/sys/powerpc/powerpc/mmu_oea.c index b7f2d05e3621..cc28d4b7f96c 100644 --- a/sys/powerpc/powerpc/mmu_oea.c +++ b/sys/powerpc/powerpc/mmu_oea.c @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -1639,7 +1640,10 @@ pmap_growkernel(vm_offset_t addr) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); } diff --git a/sys/powerpc/powerpc/pmap.c b/sys/powerpc/powerpc/pmap.c index b7f2d05e3621..cc28d4b7f96c 100644 --- a/sys/powerpc/powerpc/pmap.c +++ b/sys/powerpc/powerpc/pmap.c @@ -62,6 +62,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -1639,7 +1640,10 @@ pmap_growkernel(vm_offset_t addr) void pmap_init2() { - pv_entry_max = PMAP_SHPGPERPROC * maxproc + vm_page_array_size; + 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); zinitna(pvzone, &pvzone_obj, NULL, 0, pv_entry_max, ZONE_INTERRUPT, 1); }