remove obsolete variables NKMEMPAGES_MIN/ NKMEMPAGES_MAX

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

remove obsolete variables NKMEMPAGES_MIN/ NKMEMPAGES_MAX

Amit Kulkarni-5


Index: regress/usr.bin/diff/t8.2
===================================================================
RCS file: /cvs/src/regress/usr.bin/diff/t8.2,v
retrieving revision 1.1
diff -u -p -r1.1 t8.2
--- regress/usr.bin/diff/t8.2 17 Jul 2003 21:04:04 -0000 1.1
+++ regress/usr.bin/diff/t8.2 7 Jul 2013 21:54:34 -0000
@@ -58,18 +58,6 @@ struct vm_map *kmem_map = NULL;
 #endif
 int nkmempages = NKMEMPAGES;
 
-/*
- * Defaults for lower- and upper-bounds for the kmem_map page count.
- * Can be overridden by kernel config options.
- */
-#ifndef NKMEMPAGES_MIN
-#define NKMEMPAGES_MIN NKMEMPAGES_MIN_DEFAULT
-#endif
-
-#ifndef NKMEMPAGES_MAX
-#define NKMEMPAGES_MAX NKMEMPAGES_MAX_DEFAULT
-#endif
-
 struct kmembuckets bucket[MINBUCKET + 16];
 struct kmemstats kmemstats[M_LAST];
 struct kmemusage *kmemusage;
@@ -434,8 +422,6 @@ free(addr, type)
 void
 kmeminit_nkmempages()
 {
- int npages;
-
  if (nkmempages != 0) {
  /*
  * It's already been set (by us being here before, or
@@ -446,22 +432,13 @@ kmeminit_nkmempages()
 
  /*
  * We use the following (simple) formula:
- *
  * - Starting point is physical memory / 4.
- *
- * - Clamp it down to NKMEMPAGES_MAX.
- *
- * - Round it up to NKMEMPAGES_MIN.
+ * - If that is excessive, limit it to NKMEMPAGES_MAX_DEFAULT.
  */
- npages = physmem / 4;
-
- if (npages > NKMEMPAGES_MAX)
- npages = NKMEMPAGES_MAX;
-
- if (npages < NKMEMPAGES_MIN)
- npages = NKMEMPAGES_MIN;
+ nkmempages = physmem / 4;
 
- nkmempages = npages;
+ if (nkmempages > NKMEMPAGES_MAX_DEFAULT)
+ nkmempages = NKMEMPAGES_MAX_DEFAULT;
 }
 
 /*
Index: sys/kern/kern_malloc.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_malloc.c,v
retrieving revision 1.102
diff -u -p -r1.102 kern_malloc.c
--- sys/kern/kern_malloc.c 4 Jul 2013 17:35:52 -0000 1.102
+++ sys/kern/kern_malloc.c 7 Jul 2013 21:54:37 -0000
@@ -85,8 +85,8 @@ struct vm_map *kmem_map = NULL;
 #endif
 
 /*
- * Default number of pages in kmem_map.  We attempt to calculate this
- * at run-time, but allow it to be either patched or set in the kernel
+ * Default number of pages in kmem_map.  We calculate this at
+ * compile-time, but also allow it to be either patched or set in the kernel
  * config file.
  */
 #ifndef NKMEMPAGES
@@ -94,20 +94,6 @@ struct vm_map *kmem_map = NULL;
 #endif
 u_int nkmempages = NKMEMPAGES;
 
-/*
- * Defaults for lower- and upper-bounds for the kmem_map page count.
- * Can be overridden by kernel config options.
- */
-#ifndef NKMEMPAGES_MIN
-#define NKMEMPAGES_MIN 0
-#endif
-u_int nkmempages_min = 0;
-
-#ifndef NKMEMPAGES_MAX
-#define NKMEMPAGES_MAX NKMEMPAGES_MAX_DEFAULT
-#endif
-u_int nkmempages_max = 0;
-
 struct kmembuckets bucket[MINBUCKET + 16];
 #ifdef KMEMSTATS
 struct kmemstats kmemstats[M_LAST];
@@ -475,8 +461,6 @@ free(void *addr, int type)
 void
 kmeminit_nkmempages(void)
 {
- u_int npages;
-
  if (nkmempages != 0) {
  /*
  * It's already been set (by us being here before, or
@@ -490,30 +474,14 @@ kmeminit_nkmempages(void)
  * the page size may not be known (on sparc GENERIC kernels, for
  * example). But we still want the MD code to be able to provide
  * better values.
- */
- if (nkmempages_min == 0)
- nkmempages_min = NKMEMPAGES_MIN;
- if (nkmempages_max == 0)
- nkmempages_max = NKMEMPAGES_MAX;
-
- /*
  * We use the following (simple) formula:
- *
  * - Starting point is physical memory / 4.
- *
- * - Clamp it down to nkmempages_max.
- *
- * - Round it up to nkmempages_min.
+ * - If that is excessive, limit it to NKMEMPAGES_MAX_DEFAULT.
  */
- npages = physmem / 4;
-
- if (npages > nkmempages_max)
- npages = nkmempages_max;
-
- if (npages < nkmempages_min)
- npages = nkmempages_min;
+ nkmempages = physmem / 4;
 
- nkmempages = npages;
+ if (nkmempages > NKMEMPAGES_MAX_DEFAULT)
+ nkmempages = NKMEMPAGES_MAX_DEFAULT;
 }
 
 /*