svn commit: r242805 - in user/alfred/9-alfred/sys: i386/include kern
Alfred Perlstein
alfred at FreeBSD.org
Thu Nov 8 23:24:03 UTC 2012
Author: alfred
Date: Thu Nov 8 23:24:02 2012
New Revision: 242805
URL: http://svnweb.freebsd.org/changeset/base/242805
Log:
clip maxusers based on MD VM_MAX_AUTOTUNE_MAXUSERS.
Modified:
user/alfred/9-alfred/sys/i386/include/vmparam.h
user/alfred/9-alfred/sys/kern/subr_param.c
Modified: user/alfred/9-alfred/sys/i386/include/vmparam.h
==============================================================================
--- user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov 8 23:21:02 2012 (r242804)
+++ user/alfred/9-alfred/sys/i386/include/vmparam.h Thu Nov 8 23:24:02 2012 (r242805)
@@ -202,9 +202,14 @@
#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */
+#ifndef VM_MAX_AUTOTUNE_MAXUSERS
+#define VM_MAX_AUTOTUNE_MAXUSERS 384
+#endif
+
#ifndef MAX_AUTOTUNE_NMBCLUSTERS
/* old maxusers max value. */
#define MAX_AUTOTUNE_NMBCLUSTERS (1024 + 384 * 64)
#endif
+
#endif /* _MACHINE_VMPARAM_H_ */
Modified: user/alfred/9-alfred/sys/kern/subr_param.c
==============================================================================
--- user/alfred/9-alfred/sys/kern/subr_param.c Thu Nov 8 23:21:02 2012 (r242804)
+++ user/alfred/9-alfred/sys/kern/subr_param.c Thu Nov 8 23:24:02 2012 (r242805)
@@ -278,16 +278,16 @@ init_param2(long physpages)
maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE);
if (maxusers < 32)
maxusers = 32;
+#ifdef VM_MAX_AUTOTUNE_MAXUSERS
+ if (maxusers > VM_MAX_AUTOTUNE_MAXUSERS)
+ maxusers = VM_MAX_AUTOTUNE_MAXUSERS;
+#endif
/*
- * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit.
- * Scales it down 6x for large memory machines.
+ * Scales down the function in which maxusers grows once
+ * we hit 384
*/
- if (maxusers > 384) {
- if (sizeof(void *) <= 4)
- maxusers = 384;
- else
- maxusers = 384 + ((maxusers - 384) / 6);
- }
+ if (maxusers > 384)
+ maxusers = 384 + ((maxusers - 384) / 4);
}
/*
More information about the svn-src-user
mailing list