git: 2011b44fa3f2 - main - softdep_request_cleanup: wait for softdep_request_clean_flush() to pass

Konstantin Belousov kib at FreeBSD.org
Fri Feb 12 01:07:31 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=2011b44fa3f2b2bd5a24be01094420cce9144b2d

commit 2011b44fa3f2b2bd5a24be01094420cce9144b2d
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-02-03 23:58:05 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-02-12 01:02:22 +0000

    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
---
 sys/ufs/ffs/ffs_softdep.c | 6 ++++++
 1 file changed, 6 insertions(+)

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;
 		}


More information about the dev-commits-src-main mailing list