There exists a possible sequence of page table page allocation failures

starting with a superpage demotion by pmap_enter() that could result in
a PV list lock being held when pmap_enter() is just about to return
KERN_RESOURCE_SHORTAGE.  Consequently, the KASSERT that no PV list locks
are held needs to be replaced with a conditional unlock.

Discussed with:	kib
X-MFC with:	r269728
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Alan Cox 2014-08-18 20:28:08 +00:00
parent 274919e965
commit ada1ae623e

View File

@ -4201,9 +4201,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va),
nosleep ? NULL : &lock);
if (mpte == NULL && nosleep) {
KASSERT(lock == NULL, ("lock leaked for nosleep"));
PMAP_UNLOCK(pmap);
if (lock != NULL)
rw_wunlock(lock);
rw_runlock(&pvh_global_lock);
PMAP_UNLOCK(pmap);
return (KERN_RESOURCE_SHORTAGE);
}
goto retry;