diff options
author | alc <alc@FreeBSD.org> | 2014-11-15 23:40:44 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2014-11-15 23:40:44 +0000 |
commit | aeebd38e4bfe2d40d4c39fab6702b4140abbada4 (patch) | |
tree | 0f1c627f32faa09851b8a412dd9586dabb0109ad /sys/i386 | |
parent | 07e17a18ac8e355a9f6b268acbe7b870e31f7fad (diff) | |
download | FreeBSD-src-aeebd38e4bfe2d40d4c39fab6702b4140abbada4.zip FreeBSD-src-aeebd38e4bfe2d40d4c39fab6702b4140abbada4.tar.gz |
Enable the use of VM_PHYSSEG_SPARSE on amd64 and i386, making it the default
on i386 PAE. Previously, VM_PHYSSEG_SPARSE could not be used on amd64 and
i386 because vm_page_startup() would not create vm_page structures for the
kernel page table pages allocated during pmap_bootstrap() but those vm_page
structures are needed when the kernel attempts to promote the corresponding
kernel virtual addresses to superpage mappings. To address this problem, a
new public function, vm_phys_add_seg(), is introduced and vm_phys_init() is
updated to reflect the creation of vm_phys_seg structures by calls to
vm_phys_add_seg().
Discussed with: Svatopluk Kraus
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 9 | ||||
-rw-r--r-- | sys/i386/include/vmparam.h | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 8513724..68b44e9 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -375,6 +375,15 @@ pmap_bootstrap(vm_paddr_t firstaddr) int i; /* + * Add a physical memory segment (vm_phys_seg) corresponding to the + * preallocated kernel page table pages so that vm_page structures + * representing these pages will be created. The vm_page structures + * are required for promotion of the corresponding kernel virtual + * addresses to superpage mappings. + */ + vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); + + /* * Initialize the first available kernel virtual address. However, * using "firstaddr" may waste a few pages of the kernel virtual * address space, because locore may not have mapped every physical diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h index 975b302..5dc5669 100644 --- a/sys/i386/include/vmparam.h +++ b/sys/i386/include/vmparam.h @@ -64,9 +64,15 @@ #endif /* - * The physical address space is densely populated. + * Choose between DENSE and SPARSE based on whether lower execution time or + * lower kernel address space consumption is desired. Under PAE, kernel + * address space is often in short supply. */ +#ifdef PAE +#define VM_PHYSSEG_SPARSE +#else #define VM_PHYSSEG_DENSE +#endif /* * The number of PHYSSEG entries must be one greater than the number |