From nobody Fri Oct 22 13:33:30 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A874317F589E; Fri, 22 Oct 2021 13:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbQKQ40zRz4vmM; Fri, 22 Oct 2021 13:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6915B78C2; Fri, 22 Oct 2021 13:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19MDXUne018818; Fri, 22 Oct 2021 13:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MDXUd8018817; Fri, 22 Oct 2021 13:33:30 GMT (envelope-from git) Date: Fri, 22 Oct 2021 13:33:30 GMT Message-Id: <202110221333.19MDXUd8018817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d7acbe481d17 - main - vm_page: Break reservations to handle noobj allocations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7acbe481d17ccb81c2b879b9731c83b018f3094 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d7acbe481d17ccb81c2b879b9731c83b018f3094 commit d7acbe481d17ccb81c2b879b9731c83b018f3094 Author: Mark Johnston AuthorDate: 2021-10-21 15:46:25 +0000 Commit: Mark Johnston CommitDate: 2021-10-22 13:25:59 +0000 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 --- sys/vm/vm_page.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) {