mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
committed by
Dave Chinner
parent
4eb56069cb
commit
1ccb0745a9
@@ -1422,10 +1422,18 @@ xlog_cil_push_background(
|
|||||||
ASSERT(!test_bit(XLOG_CIL_EMPTY, &cil->xc_flags));
|
ASSERT(!test_bit(XLOG_CIL_EMPTY, &cil->xc_flags));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't do a background push if we haven't used up all the
|
* We are done if:
|
||||||
* space available yet.
|
* - we haven't used up all the space available yet; or
|
||||||
|
* - we've already queued up a push; and
|
||||||
|
* - we're not over the hard limit; and
|
||||||
|
* - nothing has been over the hard limit.
|
||||||
|
*
|
||||||
|
* If so, we don't need to take the push lock as there's nothing to do.
|
||||||
*/
|
*/
|
||||||
if (space_used < XLOG_CIL_SPACE_LIMIT(log)) {
|
if (space_used < XLOG_CIL_SPACE_LIMIT(log) ||
|
||||||
|
(cil->xc_push_seq == cil->xc_current_sequence &&
|
||||||
|
space_used < XLOG_CIL_BLOCKING_SPACE_LIMIT(log) &&
|
||||||
|
!waitqueue_active(&cil->xc_push_wait))) {
|
||||||
up_read(&cil->xc_ctx_lock);
|
up_read(&cil->xc_ctx_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user