aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-02-03 23:58:05 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-12 01:02:22 +0000
commit2011b44fa3f2b2bd5a24be01094420cce9144b2d (patch)
tree963fc2a8a64429bc3aaa0788f6771dd09458b735 /sys
parent013168db8cea926c3dde1247d400d6bedf9a889d (diff)
downloadsrc-2011b44fa3f2b2bd5a24be01094420cce9144b2d.tar.gz
src-2011b44fa3f2b2bd5a24be01094420cce9144b2d.zip
softdep_request_cleanup: wait for softdep_request_clean_flush() to pass
if we noted a parallel request is active and declined to overflow the system with parallel redundant sync of the vnodes. But we need to wait for the flush to finish to see if there are any freed resources. Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 8c3ae9dd95fc..8c52139687f9 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -13847,6 +13847,7 @@ retry:
failed_vnode = softdep_request_cleanup_flush(mp, ump);
ACQUIRE_LOCK(ump);
ump->um_softdep->sd_flags &= ~FLUSH_RC_ACTIVE;
+ wakeup(&ump->um_softdep->sd_flags);
FREE_LOCK(ump);
if (ump->softdep_on_worklist > 0) {
stat_cleanup_retries += 1;
@@ -13854,6 +13855,11 @@ retry:
goto retry;
}
} else {
+ while ((ump->um_softdep->sd_flags &
+ FLUSH_RC_ACTIVE) != 0) {
+ msleep(&ump->um_softdep->sd_flags,
+ LOCK_PTR(ump), PVM, "ffsrca", hz);
+ }
FREE_LOCK(ump);
error = 0;
}