summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-07-04 08:55:18 +0000
committerjhb <jhb@FreeBSD.org>2000-07-04 08:55:18 +0000
commit183fce400a601506da0cfa9ecc09a487de36f892 (patch)
tree226e9e26f29d24e7141e2f0bb8c3d389df2bc782
parentbe6e69fbed7c32d6f6b825932f4a9a1c6d414c8a (diff)
downloadFreeBSD-src-183fce400a601506da0cfa9ecc09a487de36f892.zip
FreeBSD-src-183fce400a601506da0cfa9ecc09a487de36f892.tar.gz
Replace the PQ_*CACHE options with a single PQ_CACHESIZE option that you
set equal to the number of kilobytes in your cache. The old options are still supported for backwards compatibility. Submitted by: Kelly Yancey <kbyanc@posi.net>
-rw-r--r--sys/conf/NOTES4
-rw-r--r--sys/conf/options1
-rw-r--r--sys/i386/conf/NOTES4
-rw-r--r--sys/vm/vm_page.h55
4 files changed, 38 insertions, 26 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index b11bb9e..9bab666 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -74,8 +74,10 @@ options DFLDSIZ="(256*1024*1024)"
options BLKDEV_IOSIZE=8192
# Options for the VM subsystem
+options PQ_CACHESIZE=512 # color for 512k/16k cache
+# Deprecated options supported for backwards compatibility
#options PQ_NOOPT # No coloring
-options PQ_LARGECACHE # color for 512k/16k cache
+#options PQ_LARGECACHE # color for 512k/16k cache
#options PQ_HUGECACHE # color for 1024k/16k cache
#options PQ_MEDIUMCACHE # color for 64k/16k cache
#options PQ_NORMALCACHE # color for 256k/16k cache
diff --git a/sys/conf/options b/sys/conf/options
index 7b8552d..0333042 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -361,6 +361,7 @@ PQ_NORMALCACHE opt_vmpage.h
PQ_MEDIUMCACHE opt_vmpage.h
PQ_LARGECACHE opt_vmpage.h
PQ_HUGECACHE opt_vmpage.h
+PQ_CACHESIZE opt_vmpage.h
# Standard SMP options
SMP opt_global.h
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index b11bb9e..9bab666 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -74,8 +74,10 @@ options DFLDSIZ="(256*1024*1024)"
options BLKDEV_IOSIZE=8192
# Options for the VM subsystem
+options PQ_CACHESIZE=512 # color for 512k/16k cache
+# Deprecated options supported for backwards compatibility
#options PQ_NOOPT # No coloring
-options PQ_LARGECACHE # color for 512k/16k cache
+#options PQ_LARGECACHE # color for 512k/16k cache
#options PQ_HUGECACHE # color for 1024k/16k cache
#options PQ_MEDIUMCACHE # color for 64k/16k cache
#options PQ_NORMALCACHE # color for 256k/16k cache
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index a25c6ac..0fb6b48 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -151,46 +151,53 @@ struct vm_page {
*/
/* Each of PQ_FREE, and PQ_CACHE have PQ_HASH_SIZE entries */
-/* Define one of the following */
+/* Backward compatibility for existing PQ_*CACHE config options. */
+#if !defined(PQ_CACHESIZE)
#if defined(PQ_HUGECACHE)
+#define PQ_CACHESIZE 1024
+#elsif defined(PQ_LARGECACHE)
+#define PQ_CACHESIZE 512
+#elsif defined(PQ_MEDIUMCACHE)
+#define PQ_CACHESIZE 256
+#elsif defined(PQ_NORMALCACHE)
+#define PQ_CACHESIZE 64
+#elsif defined(PQ_NOOPT)
+#define PQ_CACHESIZE 0
+#else
+#define PQ_CACHESIZE 128
+#endif
+#endif
+
+#if PQ_CACHESIZE >= 1024
#define PQ_PRIME1 31 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_PRIME2 23 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_L2_SIZE 256 /* A number of colors opt for 1M cache */
-#endif
-/* Define one of the following */
-#if defined(PQ_LARGECACHE)
+#elsif PQ_CACHESIZE >= 512
#define PQ_PRIME1 31 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_PRIME2 23 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_L2_SIZE 128 /* A number of colors opt for 512K cache */
-#endif
+#elsif PQ_CACHESIZE >= 256
+#define PQ_PRIME1 13 /* Prime number somewhat less than PQ_HASH_SIZE */
+#define PQ_PRIME2 7 /* Prime number somewhat less than PQ_HASH_SIZE */
+#define PQ_L2_SIZE 64 /* A number of colors opt for 256K cache */
-/*
- * Use 'options PQ_NOOPT' to disable page coloring
- */
-#if defined(PQ_NOOPT)
-#define PQ_PRIME1 1
-#define PQ_PRIME2 1
-#define PQ_L2_SIZE 1
-#endif
+#elsif PQ_CACHESIZE >= 128
+#define PQ_PRIME1 9 /* Produces a good PQ_L2_SIZE/3 + PQ_PRIME1 */
+#define PQ_PRIME2 5 /* Prime number somewhat less than PQ_HASH_SIZE */
+#define PQ_L2_SIZE 32 /* A number of colors opt for 128k cache */
-#if defined(PQ_NORMALCACHE)
+#elsif PQ_CACHESIZE >= 64
#define PQ_PRIME1 5 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_PRIME2 3 /* Prime number somewhat less than PQ_HASH_SIZE */
#define PQ_L2_SIZE 16 /* A reasonable number of colors (opt for 64K cache) */
-#endif
-#if defined(PQ_MEDIUMCACHE)
-#define PQ_PRIME1 13 /* Prime number somewhat less than PQ_HASH_SIZE */
-#define PQ_PRIME2 7 /* Prime number somewhat less than PQ_HASH_SIZE */
-#define PQ_L2_SIZE 64 /* A number of colors opt for 256K cache */
-#endif
+#else
+#define PQ_PRIME1 1 /* Disable page coloring. */
+#define PQ_PRIME2 1
+#define PQ_L2_SIZE 1
-#if !defined(PQ_L2_SIZE)
-#define PQ_PRIME1 9 /* Produces a good PQ_L2_SIZE/3 + PQ_PRIME1 */
-#define PQ_PRIME2 5 /* Prime number somewhat less than PQ_HASH_SIZE */
-#define PQ_L2_SIZE 32 /* 512KB or smaller, 4-way set-associative cache */
#endif
#define PQ_L2_MASK (PQ_L2_SIZE - 1)
OpenPOWER on IntegriCloud