Commit e677d0f9 authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner

xfs: reduce the number of AIL push wakeups

The xfaild often tries to rest to wait for congestion to pass of for
IO to complete, but is regularly woken in tail-pushing situations.
In severe cases, the xfsaild is getting woken tens of thousands of
times a second. Reduce the number needless wakeups by only waking
the xfsaild if the new target is larger than the old one. Further
make short sleeps uninterruptible as they occur when the xfsaild has
decided it needs to back off to allow some IO to complete and being
woken early is counter-productive.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 0e57f6a3
...@@ -834,8 +834,11 @@ xfsaild_wakeup( ...@@ -834,8 +834,11 @@ xfsaild_wakeup(
struct xfs_ail *ailp, struct xfs_ail *ailp,
xfs_lsn_t threshold_lsn) xfs_lsn_t threshold_lsn)
{ {
/* only ever move the target forwards */
if (XFS_LSN_CMP(threshold_lsn, ailp->xa_target) > 0) {
ailp->xa_target = threshold_lsn; ailp->xa_target = threshold_lsn;
wake_up_process(ailp->xa_task); wake_up_process(ailp->xa_task);
}
} }
STATIC int STATIC int
...@@ -847,7 +850,16 @@ xfsaild( ...@@ -847,7 +850,16 @@ xfsaild(
long tout = 0; /* milliseconds */ long tout = 0; /* milliseconds */
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
schedule_timeout_interruptible(tout ? /*
* for short sleeps indicating congestion, don't allow us to
* get woken early. Otherwise all we do is bang on the AIL lock
* without making progress.
*/
if (tout && tout <= 20)
__set_current_state(TASK_KILLABLE);
else
__set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(tout ?
msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT); msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT);
/* swsusp */ /* swsusp */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment