Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).

These calls are not the same in general: the former will dequeue the
page if it is enqueued, while the latter will just leave it alone.  But,
all existing uses of the former apply to unmanaged pages, which are
never enqueued in the first place.  No functional change intended.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20470
This commit is contained in:
Mark Johnston 2019-06-07 18:23:29 +00:00
parent b934fc7468
commit 88ea538a98
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348785
13 changed files with 16 additions and 16 deletions

View File

@ -4081,7 +4081,7 @@ free_pv_chunk(struct pv_chunk *pc)
/* entire chunk is free, return it */
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
dump_drop_page(m->phys_addr);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}

View File

@ -2973,7 +2973,7 @@ free_pv_chunk(struct pv_chunk *pc)
/* entire chunk is free, return it */
m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc));
pmap_qremove((vm_offset_t)pc, 1);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
pmap_pte2list_free(&pv_vafree, (vm_offset_t)pc);
}

View File

@ -67,7 +67,7 @@ tegra_bo_destruct(struct tegra_bo *bo)
cdev_pager_free_page(bo->cdev_pager, m);
vm_page_lock(m);
m->flags &= ~PG_FICTITIOUS;
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
vm_page_unlock(m);
}

View File

@ -317,7 +317,7 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex, gfp_t gfp)
rv = vm_pager_get_pages(obj, &page, 1, NULL, NULL);
if (rv != VM_PAGER_OK) {
vm_page_lock(page);
vm_page_unwire(page, PQ_NONE);
vm_page_unwire_noq(page);
vm_page_free(page);
vm_page_unlock(page);
VM_OBJECT_WUNLOCK(obj);

View File

@ -137,7 +137,7 @@ ttm_vm_page_free(vm_page_t m)
KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("ttm got unmanaged %p", m));
m->flags &= ~PG_FICTITIOUS;
m->oflags |= VPO_UNMANAGED;
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}

View File

@ -1623,7 +1623,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old)
}
sf[i] = sf_buf_alloc(frame, SFB_NOWAIT);
if (sf[i] == NULL) {
vm_page_unwire(frame, PQ_NONE);
vm_page_unwire_noq(frame);
vm_page_free(frame);
device_printf(sc->ti_dev, "buffer allocation "
"failed -- packet dropped!\n");

View File

@ -278,7 +278,7 @@ gref_list_dtor(struct cleanup_data_struct *cleanup_data)
continue;
gnttab_free_grant_reference(gref->gref_id);
}
vm_page_unwire(gref->page, PQ_NONE);
vm_page_unwire_noq(gref->page);
vm_page_free(gref->page);
gref->page = NULL;
}

View File

@ -2465,7 +2465,7 @@ free_pv_chunk(struct pv_chunk *pc)
/* entire chunk is free, return it */
m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc));
pmap_qremove((vm_offset_t)pc, 1);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc);
}

View File

@ -1591,7 +1591,7 @@ free_pv_chunk(struct pv_chunk *pc)
/* entire chunk is free, return it */
m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS((vm_offset_t)pc));
dump_drop_page(m->phys_addr);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}

View File

@ -1648,7 +1648,7 @@ free_pv_chunk(struct pv_chunk *pc)
/* entire chunk is free, return it */
m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
dump_drop_page(m->phys_addr);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}

View File

@ -1279,9 +1279,9 @@ pcpu_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag,
zkva += PAGE_SIZE;
}
return ((void*)addr);
fail:
fail:
TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) {
vm_page_unwire(p, PQ_NONE);
vm_page_unwire_noq(p);
vm_page_free(p);
}
return (NULL);
@ -1331,7 +1331,7 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags,
* exit.
*/
TAILQ_FOREACH_SAFE(p, &alloctail, listq, p_next) {
vm_page_unwire(p, PQ_NONE);
vm_page_unwire_noq(p);
vm_page_free(p);
}
return (NULL);
@ -1392,7 +1392,7 @@ pcpu_page_free(void *mem, vm_size_t size, uint8_t flags)
for (curva = sva; curva < sva + size; curva += PAGE_SIZE) {
paddr = pmap_kextract(curva);
m = PHYS_TO_VM_PAGE(paddr);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}
pmap_qremove(sva, size >> PAGE_SHIFT);

View File

@ -408,7 +408,7 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t ks, int pages)
if (m == NULL)
panic("vm_thread_dispose: kstack already missing?");
vm_page_lock(m);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
vm_page_unlock(m);
}

View File

@ -586,7 +586,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size)
#endif
for (; offset < end; offset += PAGE_SIZE, m = next) {
next = vm_page_next(m);
vm_page_unwire(m, PQ_NONE);
vm_page_unwire_noq(m);
vm_page_free(m);
}
VM_OBJECT_WUNLOCK(object);