aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-04-14 19:45:54 +0000
committerMark Johnston <markj@FreeBSD.org>2022-04-21 13:18:14 +0000
commit11eac05a40a5b14f65dad67a65aca39f28d969a6 (patch)
tree732ff981bf8528e31dcbfcd280ab3d1e849b476b
parent9a4e70157834ecfaebe8ec4bf89dff261deaf60d (diff)
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 Sponsored by: The FreeBSD Foundation (cherry picked from commit 6fb7c42d593d13eba8b72f6cdf434a7cb23fa828)
-rw-r--r--sys/vm/vm_page.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 6cdde80bdb8b..d9feba6fe51a 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -3231,6 +3231,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);
@@ -3264,8 +3266,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);