Author: kib
Date: Thu Feb  5 13:00:27 2015
New Revision: 278257
URL: https://svnweb.freebsd.org/changeset/base/278257

Log:
  Partially revert r277922, avoid sleeping and do flush if we a awaken,
  instead of waiting for the FLUSH_* flags.  Also, when requesting
  flush, do the wakeups unconditionally even when FLUSH_CLEANUP flag was
  already set.
  
  Reported and tested by:       dim,
        "Lundberg, Johannes" <johan...@brilliantservice.co.jp>
  Bisected by:  dim
  MFC after:    2 weeks

Modified:
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c      Thu Feb  5 12:21:05 2015        
(r278256)
+++ head/sys/ufs/ffs/ffs_softdep.c      Thu Feb  5 13:00:27 2015        
(r278257)
@@ -1393,7 +1393,7 @@ softdep_flush(addr)
                    VFSTOUFS(mp)->softdep_jblocks->jb_suspended))
                        kthread_suspend_check();
                ACQUIRE_LOCK(ump);
-               while ((ump->softdep_flags & (FLUSH_CLEANUP | FLUSH_EXIT)) == 0)
+               if ((ump->softdep_flags & (FLUSH_CLEANUP | FLUSH_EXIT)) == 0)
                        msleep(&ump->softdep_flushtd, LOCK_PTR(ump), PVM,
                            "sdflush", hz / 2);
                ump->softdep_flags &= ~FLUSH_CLEANUP;
@@ -1423,10 +1423,9 @@ worklist_speedup(mp)
 
        ump = VFSTOUFS(mp);
        LOCK_OWNED(ump);
-       if ((ump->softdep_flags & (FLUSH_CLEANUP | FLUSH_EXIT)) == 0) {
+       if ((ump->softdep_flags & (FLUSH_CLEANUP | FLUSH_EXIT)) == 0)
                ump->softdep_flags |= FLUSH_CLEANUP;
-               wakeup(&ump->softdep_flushtd);
-       }
+       wakeup(&ump->softdep_flushtd);
 }
 
 static int
@@ -1471,11 +1470,10 @@ softdep_speedup(ump)
                        TAILQ_INSERT_TAIL(&softdepmounts, sdp, sd_next);
                        FREE_GBLLOCK(&lk);
                        if ((altump->softdep_flags &
-                           (FLUSH_CLEANUP | FLUSH_EXIT)) == 0) {
+                           (FLUSH_CLEANUP | FLUSH_EXIT)) == 0)
                                altump->softdep_flags |= FLUSH_CLEANUP;
-                               altump->um_softdep->sd_cleanups++;
-                               wakeup(&altump->softdep_flushtd);
-                       }
+                       altump->um_softdep->sd_cleanups++;
+                       wakeup(&altump->softdep_flushtd);
                        FREE_LOCK(altump);
                }
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to