Skip to content

Commit 1ccb074

Browse files
dgchinnerdchinner
authored andcommitted
xfs: avoid cil push lock if possible
Because now it hurts when the CIL fills up. - 37.20% __xfs_trans_commit - 35.84% xfs_log_commit_cil - 19.34% _raw_spin_lock - do_raw_spin_lock 19.01% __pv_queued_spin_lock_slowpath - 4.20% xfs_log_ticket_ungrant 0.90% xfs_log_space_wake Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
1 parent 4eb5606 commit 1ccb074

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

fs/xfs/xfs_log_cil.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,10 +1422,18 @@ xlog_cil_push_background(
14221422
ASSERT(!test_bit(XLOG_CIL_EMPTY, &cil->xc_flags));
14231423

14241424
/*
1425-
* Don't do a background push if we haven't used up all the
1426-
* space available yet.
1425+
* We are done if:
1426+
* - we haven't used up all the space available yet; or
1427+
* - we've already queued up a push; and
1428+
* - we're not over the hard limit; and
1429+
* - nothing has been over the hard limit.
1430+
*
1431+
* If so, we don't need to take the push lock as there's nothing to do.
14271432
*/
1428-
if (space_used < XLOG_CIL_SPACE_LIMIT(log)) {
1433+
if (space_used < XLOG_CIL_SPACE_LIMIT(log) ||
1434+
(cil->xc_push_seq == cil->xc_current_sequence &&
1435+
space_used < XLOG_CIL_BLOCKING_SPACE_LIMIT(log) &&
1436+
!waitqueue_active(&cil->xc_push_wait))) {
14291437
up_read(&cil->xc_ctx_lock);
14301438
return;
14311439
}

0 commit comments

Comments
 (0)