diff options
author | alc <alc@FreeBSD.org> | 2007-10-07 18:03:03 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2007-10-07 18:03:03 +0000 |
commit | 19c4fce2e39c325ffe0bd1b22f2f15e20514579f (patch) | |
tree | 6f69a336b07b412f05aaf3813afeec0a539f29ad | |
parent | 3faef0286022deb16a1b3270d26e8aeeb68434fe (diff) | |
download | FreeBSD-src-19c4fce2e39c325ffe0bd1b22f2f15e20514579f.zip FreeBSD-src-19c4fce2e39c325ffe0bd1b22f2f15e20514579f.tar.gz |
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
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index f8c37d8..eb61582 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -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); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 87c892d..10fe984 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -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)) |