summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/pmap.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-04-08 19:46:13 +0000
committerkib <kib@FreeBSD.org>2015-04-08 19:46:13 +0000
commit006ec965299dcd8d9be11a465e511393bebdea37 (patch)
tree08f0bd3dc32be0f8804184d00b9397c36392f1ca /sys/i386/include/pmap.h
parentf57a64395c7d842a3db1091751a43be732c84af2 (diff)
downloadFreeBSD-src-006ec965299dcd8d9be11a465e511393bebdea37.zip
FreeBSD-src-006ec965299dcd8d9be11a465e511393bebdea37.tar.gz
Explain that vm_page_array is mapped to describe the memory, not the
memory itself. Provide the formula to calculate the number of required page tables. Correct the size of the struct vm_page for non-PAE case. Reviewed by: alc, jhb (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/i386/include/pmap.h')
-rw-r--r--sys/i386/include/pmap.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 05656cd..2c9a409 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -122,13 +122,18 @@
*/
#define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<<PDRSHIFT)|((pti)<<PAGE_SHIFT)))
-/* Initial number of kernel page tables. */
+/*
+ * The initial number of kernel page table pages that are constructed
+ * by locore must be sufficient to map vm_page_array. That number can
+ * be calculated as follows:
+ * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR
+ * PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages.
+ * Non-PAE: max_phys 4G, sizeof(vm_page) 68, NBPDR 4M, 18 page table pages.
+ */
#ifndef NKPT
#ifdef PAE
-/* 152 page tables needed to map 16G (76B "struct vm_page", 2M page tables). */
#define NKPT 240
#else
-/* 18 page tables needed to map 4G (72B "struct vm_page", 4M page tables). */
#define NKPT 30
#endif
#endif
OpenPOWER on IntegriCloud