[PATCH 2/2] xfs: reduce the number of log forces from tail pushing
Christoph Hellwig
hch at infradead.org
Sun Aug 14 11:31:44 CDT 2011
The flush_log variable in xfs_ail_worker is non-zero after your
patch, and can be removed.
The second argument for xfs_log_force to force a sync log force is
XFS_LOG_SYNC, not SYNC_WAIT.
I also don't really like the goto again style - we can just move the log
push at the beggining of the function, the only thing it requires is
adding an additional list_empty check, e.g.:
spin_lock(&ailp->xa_lock);
/*
* If last time we ran we encountered pinned items, force the log
* first, wait for it and then push again.
*/
if (ailp->xa_last_pushed_lsn == 0 && ailp->xa_log_flush &&
!list_empty(&ailp->xa_ail)) {
ailp->xa_log_flush = 0;
spin_unlock(&ailp->xa_lock);
XFS_STATS_INC(xs_push_ail_flush);
xfs_log_force(mp, SYNC_WAIT);
spin_lock(&ailp->xa_lock);
}
target = ailp->xa_target;
lip = xfs_trans_ail_cursor_first(ailp, &cur, ailp->xa_last_pushed_lsn);
More information about the xfs
mailing list