Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_page.c
Show First 20 Lines • Show All 607 Lines • ▼ Show 20 Lines | |||||
#ifndef UMA_MD_SMALL_ALLOC | #ifndef UMA_MD_SMALL_ALLOC | ||||
/* vmem_startup() calls uma_prealloc(). */ | /* vmem_startup() calls uma_prealloc(). */ | ||||
boot_pages += vmem_startup_count(); | boot_pages += vmem_startup_count(); | ||||
/* vm_map_startup() calls uma_prealloc(). */ | /* vm_map_startup() calls uma_prealloc(). */ | ||||
boot_pages += howmany(MAX_KMAP, | boot_pages += howmany(MAX_KMAP, | ||||
slab_ipers(sizeof(struct vm_map), UMA_ALIGN_PTR)); | slab_ipers(sizeof(struct vm_map), UMA_ALIGN_PTR)); | ||||
/* | /* | ||||
* Before going fully functional kmem_init() does allocation | * Before we are fully boot strapped we need to account for the | ||||
* from "KMAP ENTRY" and vmem_create() does allocation from "vmem". | * following allocations: | ||||
* | |||||
* "KMAP ENTRY" from kmem_init() | |||||
* "vmem btag" from vmem_startup() | |||||
* "vmem" from vmem_create() | |||||
* "KMAP" from vm_map_startup() | |||||
* | |||||
* Each needs at least one page per-domain. | |||||
*/ | */ | ||||
boot_pages += 2; | boot_pages += 4 * vm_ndomains; | ||||
#endif | #endif | ||||
/* | /* | ||||
* CTFLAG_RDTUN doesn't work during the early boot process, so we must | * CTFLAG_RDTUN doesn't work during the early boot process, so we must | ||||
* manually fetch the value. | * manually fetch the value. | ||||
*/ | */ | ||||
TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); | TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); | ||||
new_end = end - (boot_pages * UMA_SLAB_SIZE); | new_end = end - (boot_pages * UMA_SLAB_SIZE); | ||||
new_end = trunc_page(new_end); | new_end = trunc_page(new_end); | ||||
▲ Show 20 Lines • Show All 4,609 Lines • Show Last 20 Lines |