Avoid redundant superpage promotion attempts on ARM
Because pmap_enter_locked() is called from few different functions some redundancy in superpage promotion attempts can be observed. Hence, avoid promotion in pmap_enter_object() (if the object can be mapped by superpage it will be handled by pmap_enter_object() itself) and also do not waste time in pmap_enter_quick(). From now on the promotion will be performed only in pmap_enter().
This commit is contained in:
parent
bdd635e646
commit
6be8284c66
@ -2924,10 +2924,21 @@ void
|
||||
pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
|
||||
vm_prot_t prot, boolean_t wired)
|
||||
{
|
||||
struct l2_bucket *l2b;
|
||||
|
||||
rw_wlock(&pvh_global_lock);
|
||||
PMAP_LOCK(pmap);
|
||||
pmap_enter_locked(pmap, va, access, m, prot, wired, M_WAITOK);
|
||||
/*
|
||||
* If both the l2b_occupancy and the reservation are fully
|
||||
* populated, then attempt promotion.
|
||||
*/
|
||||
l2b = pmap_get_l2_bucket(pmap, va);
|
||||
if ((l2b != NULL) && (l2b->l2b_occupancy == L2_PTE_NUM_TOTAL) &&
|
||||
sp_enabled && (m->flags & PG_FICTITIOUS) == 0 &&
|
||||
vm_reserv_level_iffullpop(m) == 0)
|
||||
pmap_promote_section(pmap, va);
|
||||
|
||||
PMAP_UNLOCK(pmap);
|
||||
rw_wunlock(&pvh_global_lock);
|
||||
}
|
||||
@ -3153,14 +3164,6 @@ validate:
|
||||
|
||||
if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap))
|
||||
cpu_icache_sync_range(va, PAGE_SIZE);
|
||||
/*
|
||||
* If both the l2b_occupancy and the reservation are fully
|
||||
* populated, then attempt promotion.
|
||||
*/
|
||||
if ((l2b->l2b_occupancy == L2_PTE_NUM_TOTAL) &&
|
||||
sp_enabled && (m->flags & PG_FICTITIOUS) == 0 &&
|
||||
vm_reserv_level_iffullpop(m) == 0)
|
||||
pmap_promote_section(pmap, va);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user