Date: Wed, 15 Apr 2015 06:59:53 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r281547 - stable/10/sys/i386/include Message-ID: <201504150659.t3F6xra4085103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Apr 15 06:59:53 2015 New Revision: 281547 URL: https://svnweb.freebsd.org/changeset/base/281547 Log: MFC r281272: 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. Modified: stable/10/sys/i386/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/include/pmap.h ============================================================================== --- stable/10/sys/i386/include/pmap.h Wed Apr 15 06:57:47 2015 (r281546) +++ stable/10/sys/i386/include/pmap.h Wed Apr 15 06:59:53 2015 (r281547) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504150659.t3F6xra4085103>