diff options
author | Alfred Perlstein <alfred@FreeBSD.org> | 2012-11-10 02:08:40 +0000 |
---|---|---|
committer | Alfred Perlstein <alfred@FreeBSD.org> | 2012-11-10 02:08:40 +0000 |
commit | 79f62ed69004b699d56e16b29fc2ac3a6d3a7d34 (patch) | |
tree | 2d08cbee7278cd7eea9a43b81a23320e35210c05 /sys/kern/subr_param.c | |
parent | a9b09a3f3c0eb3e479827f9a16513d4b1b7fe940 (diff) | |
download | src-79f62ed69004b699d56e16b29fc2ac3a6d3a7d34.tar.gz src-79f62ed69004b699d56e16b29fc2ac3a6d3a7d34.zip |
Allow maxusers to scale on machines with large address space.
Some hooks are added to clamp down maxusers and nmbclusters for
small address space systems.
VM_MAX_AUTOTUNE_MAXUSERS - the max maxusers that will be autotuned based on
physical memory.
VM_MAX_AUTOTUNE_NMBCLUSTERS - max nmbclusters based on physical memory.
These are set to the old values on i386 to preserve the clamping that was
being done to all arches.
Another macro VM_AUTOTUNE_NMBCLUSTERS is provided to allow an override
for the calculation on a MD basis. Currently no arch defines this.
Reviewed by: peter
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=242847
Diffstat (limited to 'sys/kern/subr_param.c')
-rw-r--r-- | sys/kern/subr_param.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index 5c9af3202e46..b953e788d16a 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -278,17 +278,17 @@ init_param2(long physpages) maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; - /* - * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. - * Scales it down 6x for large memory machines. - */ - if (maxusers > 384) { - if (sizeof(void *) <= 4) - maxusers = 384; - else - maxusers = 384 + ((maxusers - 384) / 6); - } - } +#ifdef VM_MAX_AUTOTUNE_MAXUSERS + if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS) + maxusers = VM_MAX_AUTOTUNE_MAXUSERS; +#endif + /* + * Scales down the function in which maxusers grows once + * we hit 384. + */ + if (maxusers > 384) + maxusers = 384 + ((maxusers - 384) / 8); + } /* * The following can be overridden after boot via sysctl. Note: |