]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfs: fix high load average due to callback thread sleeping
authorJeff Layton <jlayton@poochiereds.net>
Fri, 20 Mar 2015 19:15:14 +0000 (15:15 -0400)
committerZefan Li <lizefan@huawei.com>
Fri, 18 Sep 2015 01:20:32 +0000 (09:20 +0800)
commit20db578815361ac06fca1c03ef555324f00111d0
treedc6db94746a925528935d0767ecc011f50d40b4d
parentc9e5b3b7e731d070f5a95362281ea49718eb434d
nfs: fix high load average due to callback thread sleeping

commit 5d05e54af3cdbb13cf19c557ff2184781b91a22c upstream.

Chuck pointed out a problem that crept in with commit 6ffa30d3f734 (nfs:
don't call blocking operations while !TASK_RUNNING). Linux counts tasks
in uninterruptible sleep against the load average, so this caused the
system's load average to be pinned at at least 1 when there was a
NFSv4.1+ mount active.

Not a huge problem, but it's probably worth fixing before we get too
many complaints about it. This patch converts the code back to use
TASK_INTERRUPTIBLE sleep, simply has it flush any signals on each loop
iteration. In practice no one should really be signalling this thread at
all, so I think this is reasonably safe.

With this change, there's also no need to game the hung task watchdog so
we can also convert the schedule_timeout call back to a normal schedule.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Fixes: commit 6ffa30d3f734 (“nfs: don't call blocking . . .”)
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
fs/nfs/callback.c