There is no need to use VM_OBJECT_LOCKED() as the assertion won't

make the check available in any case if INVARIANTS is switched off.
Remove VM_OBJECT_LOCKED().
This commit is contained in:
attilio 2013-02-20 10:51:34 +00:00
parent 6a2e2ce522
commit 1f1e13ca03
8 changed files with 14 additions and 23 deletions

View File

@ -3492,9 +3492,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
KASSERT((m->oflags & VPO_UNMANAGED) != 0 || va < kmi.clean_sva ||
va >= kmi.clean_eva,
("pmap_enter: managed mapping within the clean submap"));
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("pmap_enter: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
pa = VM_PAGE_TO_PHYS(m);
newpte = (pt_entry_t)(pa | PG_A | PG_V);
if ((access & VM_PROT_WRITE) != 0)

View File

@ -3456,9 +3456,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS,
("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)",
va));
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("pmap_enter: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
mpte = NULL;

View File

@ -2666,9 +2666,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m,
KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS,
("pmap_enter: invalid to pmap_enter page table pages (va: 0x%x)",
va));
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("pmap_enter: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
mpte = NULL;

View File

@ -1122,9 +1122,8 @@ moea_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
if (pmap_bootstrapped)
rw_assert(&pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("moea_enter_locked: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
/* XXX change the pvo head for fake pages */
if ((m->oflags & VPO_UNMANAGED) != 0) {

View File

@ -1184,9 +1184,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
pvo_flags = PVO_MANAGED;
}
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("moea64_enter: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
/* XXX change the pvo head for fake pages */
if ((m->oflags & VPO_UNMANAGED) != 0) {

View File

@ -1561,9 +1561,8 @@ mmu_booke_enter_locked(mmu_t mmu, pmap_t pmap, vm_offset_t va, vm_page_t m,
KASSERT((va <= VM_MAXUSER_ADDRESS),
("mmu_booke_enter_locked: user pmap, non user va"));
}
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("mmu_booke_enter_locked: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);

View File

@ -1494,9 +1494,8 @@ pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot,
rw_assert(&tte_list_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pm, MA_OWNED);
KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
VM_OBJECT_LOCKED(m->object),
("pmap_enter_locked: page %p is not busy", m));
if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) == 0)
VM_OBJECT_LOCK_ASSERT(m->object, RA_WLOCKED);
PMAP_STATS_INC(pmap_nenter);
pa = VM_PAGE_TO_PHYS(m);

View File

@ -210,8 +210,6 @@ extern struct vm_object kmem_object_store;
rw_assert(&(object)->lock, (type))
#define VM_OBJECT_LOCK_INIT(object, name) \
rw_init_flags(&(object)->lock, (name), RW_DUPOK)
#define VM_OBJECT_LOCKED(object) \
rw_wowned(&(object)->lock)
#define VM_OBJECT_SLEEP(wchan, object, pri, wmesg, timo) \
rw_sleep((wchan), &(object)->lock, (pri), (wmesg), (timo))
#define VM_OBJECT_TRYLOCK(object) \