summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.h
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 /sys/vm/vm_page.h
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>
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r--sys/vm/vm_page.h55
1 files changed, 31 insertions, 24 deletions
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