Commit d7acbe48 authored by Mark Johnston's avatar Mark Johnston
Browse files

vm_page: Break reservations to handle noobj allocations

vm_reserv_reclaim_*() will release pages to the default freepool, not
the direct freepool from which noobj allocations are drawn.  But if both
pools are empty, the noobj allocator variants must break reservations to
make progress.

Reported by:	cy
Reviewed by:	kib (previous version)
Fixes:	b498f71b ("vm_page: Add a new page allocator interface for unnamed pages")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32592
parent 4e4c84f8
......@@ -2409,8 +2409,14 @@ _vm_page_alloc_noobj_domain(int domain, const int freelist, int req)
m = vm_phys_alloc_freelist_pages(domain, freelist,
VM_FREEPOOL_DIRECT, 0);
vm_domain_free_unlock(vmd);
if (m == NULL)
if (m == NULL) {
vm_domain_freecnt_inc(vmd, 1);
#if VM_NRESERVLEVEL > 0
if (freelist == VM_NFREELIST &&
vm_reserv_reclaim_inactive(domain))
goto again;
#endif
}
}
if (m == NULL) {
if (vm_domain_alloc_fail(vmd, NULL, req))
......@@ -2540,6 +2546,11 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages,
vm_domain_free_unlock(vmd);
if (m_ret == NULL) {
vm_domain_freecnt_inc(vmd, npages);
#if VM_NRESERVLEVEL > 0
if (vm_reserv_reclaim_contig(domain, npages, low,
high, alignment, boundary))
goto again;
#endif
}
}
if (m_ret == NULL) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment