Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nfs: fix high load average due to callback thread sleeping

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.

Cc: <stable@vger.kernel.org>
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>

authored by

Jeff Layton and committed by
Trond Myklebust
5d05e54a f830f7dd

+3 -3
+3 -3
fs/nfs/callback.c
··· 128 128 if (try_to_freeze()) 129 129 continue; 130 130 131 - prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_UNINTERRUPTIBLE); 131 + prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIBLE); 132 132 spin_lock_bh(&serv->sv_cb_lock); 133 133 if (!list_empty(&serv->sv_cb_list)) { 134 134 req = list_first_entry(&serv->sv_cb_list, ··· 142 142 error); 143 143 } else { 144 144 spin_unlock_bh(&serv->sv_cb_lock); 145 - /* schedule_timeout to game the hung task watchdog */ 146 - schedule_timeout(60 * HZ); 145 + schedule(); 147 146 finish_wait(&serv->sv_cb_waitq, &wq); 148 147 } 148 + flush_signals(current); 149 149 } 150 150 return 0; 151 151 }