Correct a lock assertion failure in sparc64's pmap_page_is_mapped() that is

a consequence of sparc64/sparc64/vm_machdep.c revision 1.76.  It occurs
when uma_small_free() frees a page.  The solution has two parts: (1) Mark
pages allocated with VM_ALLOC_NOOBJ as PG_UNMANAGED.  (2) Defer the lock
assertion in pmap_page_is_mapped() until after PG_UNMANAGED is tested.
This is safe because both PG_UNMANAGED and PG_FICTITIOUS are immutable
flags, i.e., they do not change state between the time that a page is
allocated and freed.

Approved by:	re (kensmith)
PR:		116794
This commit is contained in:
alc 2007-10-07 18:03:03 +00:00
parent 3faef02860
commit 19c4fce2e3
2 changed files with 2 additions and 2 deletions

View File

@ -1765,9 +1765,9 @@ pmap_page_is_mapped(vm_page_t m)
{
struct tte *tp;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
return (FALSE);
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) {
if ((tp->tte_data & TD_PV) != 0)
return (TRUE);

View File

@ -1086,7 +1086,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req)
if (req & VM_ALLOC_ZERO)
flags = PG_ZERO;
}
if (object != NULL && object->type == OBJT_PHYS)
if (object == NULL || object->type == OBJT_PHYS)
flags |= PG_UNMANAGED;
m->flags = flags;
if (req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ))