aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-10-21 15:46:25 +0000
committerMark Johnston <markj@FreeBSD.org>2021-10-22 13:25:59 +0000
commitd7acbe481d17ccb81c2b879b9731c83b018f3094 (patch)
tree08f7e719e081847a7a6d53963a9e6335ece70fb0
parent4e4c84f8d101216ebf303f04ce9d4327c3328059 (diff)
downloadsrc-d7acbe481d17ccb81c2b879b9731c83b018f3094.tar.gz
src-d7acbe481d17ccb81c2b879b9731c83b018f3094.zip
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: b498f71bc56a ("vm_page: Add a new page allocator interface for unnamed pages") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32592
-rw-r--r--sys/vm/vm_page.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index eca5d0801b7f..76e9ba4db403 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -2409,8 +2409,14 @@ again:
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 @@ again:
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) {