summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-11-13 20:33:54 +0000
committerru <ru@FreeBSD.org>2006-11-13 20:33:54 +0000
commit9c4d5bd7a3fa5429413c842e1b0e7eecb56b92ab (patch)
treed991955a13f03a7ba22ef710befdf8b5b708d7d0
parenta781fbf35b57dd3a975e6dace3e55491c1d0419e (diff)
downloadFreeBSD-src-9c4d5bd7a3fa5429413c842e1b0e7eecb56b92ab.zip
FreeBSD-src-9c4d5bd7a3fa5429413c842e1b0e7eecb56b92ab.tar.gz
Fix NKPT comments to match reality. Note that the current value
of NKPT is no longer enough to run amd64 with 16G of RAM, as it doesn't have space for mapping a kernel (16M kernel would require additionally 8 page tables).
-rw-r--r--sys/amd64/include/pmap.h5
-rw-r--r--sys/i386/include/pmap.h9
2 files changed, 9 insertions, 5 deletions
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 22ec67c..df89589 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -101,9 +101,10 @@
((unsigned long)(l2) << PDRSHIFT) | \
((unsigned long)(l1) << PAGE_SHIFT))
-/* Initial number of kernel page tables */
+/* Initial number of kernel page tables. */
#ifndef NKPT
-#define NKPT 240 /* Enough for 16GB (2MB page tables) */
+/* 240 page tables needed to map 16G (120B "struct vm_page", 2M page tables). */
+#define NKPT 240
#endif
#define NKPML4E 1 /* number of kernel PML4 slots */
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 6e757a6..996795f 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -98,14 +98,17 @@
*/
#define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<<PDRSHIFT)|((pti)<<PAGE_SHIFT)))
-/* Actual number of kernel page tables */
+/* Initial number of kernel page tables. */
#ifndef NKPT
#ifdef PAE
-#define NKPT 240 /* Enough for 16GB (2MB page tables) */
+/* 152 page tables needed to map 16G (76B "struct vm_page", 2M page tables). */
+#define NKPT 240
#else
-#define NKPT 30 /* Enough for 4GB (4MB page tables) */
+/* 18 page tables needed to map 4G (72B "struct vm_page", 4M page tables). */
+#define NKPT 30
#endif
#endif
+
#ifndef NKPDE
#ifdef SMP
#define NKPDE (KVA_PAGES - 1) /* number of page tables/pde's */
OpenPOWER on IntegriCloud