Skip to content

Commit 04d6dbb

Browse files
Darrick J. WongChandan Babu R
authored andcommitted
xfs: revert AIL TASK_KILLABLE threshold
In commit 9adf402, we changed the behavior of the AIL thread to set its own task state to KILLABLE whenever the timeout value is nonzero. Unfortunately, this missed the fact that xfsaild_push will return 50ms (aka a longish sleep) when we reach the push target or the AIL becomes empty, so xfsaild goes to sleep for a long period of time in uninterruptible D state. This results in artificially high load averages because KILLABLE processes are UNINTERRUPTIBLE, which contributes to load average even though the AIL is asleep waiting for someone to interrupt it. It's not blocked on IOs or anything, but people scrap ps for processes that look like they're stuck in D state, so restore the previous threshold. Fixes: 9adf402 ("xfs: AIL doesn't need manual pushing") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
1 parent 73c34b0 commit 04d6dbb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/xfs/xfs_trans_ail.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,12 @@ xfsaild(
644644
set_freezable();
645645

646646
while (1) {
647-
if (tout)
647+
/*
648+
* Long waits of 50ms or more occur when we've run out of items
649+
* to push, so we only want uninterruptible state if we're
650+
* actually blocked on something.
651+
*/
652+
if (tout && tout <= 20)
648653
set_current_state(TASK_KILLABLE|TASK_FREEZABLE);
649654
else
650655
set_current_state(TASK_INTERRUPTIBLE|TASK_FREEZABLE);

0 commit comments

Comments
 (0)