Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Apr 2022 19:49:07 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 6fb7c42d593d - main - vm: Move the "vm_wait in early boot" assertion to the proper place
Message-ID:  <202204141949.23EJn7k8054654@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=6fb7c42d593d13eba8b72f6cdf434a7cb23fa828

commit 6fb7c42d593d13eba8b72f6cdf434a7cb23fa828
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-04-14 19:45:54 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-04-14 19:45:54 +0000

    vm: Move the "vm_wait in early boot" assertion to the proper place
    
    The assertion was added in commit 1771e987ca6a.  After that, vm_wait()
    and friends were refactored such that the actual sleep happens
    elsewhere.  Now the assertion condition is not checked when
    vm_wait_doms() is called directly, and it is checked even if we are not
    going to sleep (because vm_page_count_min_set(wdoms) is false).
    
    Reviewed by:    alc, kib
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D34909
---
 sys/vm/vm_page.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 50fe50ddb46c..6abee86a227d 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -3265,6 +3265,8 @@ vm_wait_doms(const domainset_t *wdoms, int mflags)
 		 */
 		mtx_lock(&vm_domainset_lock);
 		if (vm_page_count_min_set(wdoms)) {
+			if (pageproc == NULL)
+				panic("vm_wait in early boot");
 			vm_min_waiters++;
 			error = msleep(&vm_min_domains, &vm_domainset_lock,
 			    PVM | PDROP | mflags, "vmwait", 0);
@@ -3298,8 +3300,6 @@ vm_wait_domain(int domain)
 		} else
 			mtx_unlock(&vm_domainset_lock);
 	} else {
-		if (pageproc == NULL)
-			panic("vm_wait in early boot");
 		DOMAINSET_ZERO(&wdom);
 		DOMAINSET_SET(vmd->vmd_domain, &wdom);
 		vm_wait_doms(&wdom, 0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204141949.23EJn7k8054654>