Skip to content

Commit

Permalink
Partially revert r277922, avoid sleeping and do flush if we a awaken,
Browse files Browse the repository at this point in the history
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" <[email protected]>
Bisected by:	dim
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@278257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
  • Loading branch information
kib committed Feb 5, 2015
1 parent 116b7db commit 0998e72
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sys/ufs/ffs/ffs_softdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 0998e72

Please sign in to comment.