linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: Fix adverse effects of NFS client on interactive response
@ 2005-12-21  6:00 Peter Williams
  2005-12-21  6:09 ` Trond Myklebust
  0 siblings, 1 reply; 55+ messages in thread
From: Peter Williams @ 2005-12-21  6:00 UTC (permalink / raw)
  To: Ingo Molnar, Trond Myklebust; +Cc: Con Kolivas, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

This patch addresses the adverse effect that the NFS client can have on 
interactive response when CPU bound tasks (such as a kernel build) 
operate on files mounted via NFS.  (NB It is emphasized that this has 
nothing to do with the effects of interactive tasks accessing NFS 
mounted files themselves.)

The problem occurs because tasks accessing NFS mounted files for data 
can undergo quite a lot of TASK_INTERRUPTIBLE sleep depending on the 
load on the server and the quality of the network connection.  This can 
result in these tasks getting quite high values for sleep_avg and 
consequently a large priority bonus.  On the system where I noticed this 
problem they were getting the full 10 bonus points and being given the 
same dynamic priority as genuine interactive tasks such as the X server 
and rythmbox.

The solution to this problem is to use TASK_NONINTERACTIVE to tell the 
scheduler that the TASK_INTERRUPTIBLE sleeps in the NFS client and 
SUNRPC are NOT interactive sleeps.

Signed-off-by: Peter Williams <pwil3058@bigpond.com.au>

--

  fs/nfs/inode.c       |    3 ++-
  fs/nfs/nfs4proc.c    |    2 +-
  fs/nfs/pagelist.c    |    3 ++-
  fs/nfs/write.c       |    3 ++-
  net/sunrpc/sched.c   |    2 +-
  net/sunrpc/svcsock.c |    2 +-
  6 files changed, 9 insertions(+), 6 deletions(-)

-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

[-- Attachment #2: make-nfs-sleeps-noninteractive --]
[-- Type: text/plain, Size: 3679 bytes --]

Index: GIT-warnings/fs/nfs/inode.c
===================================================================
--- GIT-warnings.orig/fs/nfs/inode.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/fs/nfs/inode.c	2005-12-21 16:22:11.000000000 +1100
@@ -937,7 +937,8 @@ static int nfs_wait_on_inode(struct inod
 
 	rpc_clnt_sigmask(clnt, &oldmask);
 	error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING,
-					nfs_wait_schedule, TASK_INTERRUPTIBLE);
+					nfs_wait_schedule,
+					TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 	rpc_clnt_sigunmask(clnt, &oldmask);
 
 	return error;
Index: GIT-warnings/fs/nfs/nfs4proc.c
===================================================================
--- GIT-warnings.orig/fs/nfs/nfs4proc.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/fs/nfs/nfs4proc.c	2005-12-21 16:22:11.000000000 +1100
@@ -2547,7 +2547,7 @@ static int nfs4_wait_clnt_recover(struct
 	rpc_clnt_sigmask(clnt, &oldset);
 	interruptible = TASK_UNINTERRUPTIBLE;
 	if (clnt->cl_intr)
-		interruptible = TASK_INTERRUPTIBLE;
+		interruptible = TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE;
 	prepare_to_wait(&clp->cl_waitq, &wait, interruptible);
 	nfs4_schedule_state_recovery(clp);
 	if (clnt->cl_intr && signalled())
Index: GIT-warnings/fs/nfs/pagelist.c
===================================================================
--- GIT-warnings.orig/fs/nfs/pagelist.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/fs/nfs/pagelist.c	2005-12-21 16:22:11.000000000 +1100
@@ -210,7 +210,8 @@ nfs_wait_on_request(struct nfs_page *req
 	 */
 	rpc_clnt_sigmask(clnt, &oldmask);
 	ret = out_of_line_wait_on_bit(&req->wb_flags, PG_BUSY,
-			nfs_wait_bit_interruptible, TASK_INTERRUPTIBLE);
+			nfs_wait_bit_interruptible,
+			TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 	rpc_clnt_sigunmask(clnt, &oldmask);
 out:
 	return ret;
Index: GIT-warnings/fs/nfs/write.c
===================================================================
--- GIT-warnings.orig/fs/nfs/write.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/fs/nfs/write.c	2005-12-21 16:22:11.000000000 +1100
@@ -595,7 +595,8 @@ static int nfs_wait_on_write_congestion(
 		sigset_t oldset;
 
 		rpc_clnt_sigmask(clnt, &oldset);
-		prepare_to_wait(&nfs_write_congestion, &wait, TASK_INTERRUPTIBLE);
+		prepare_to_wait(&nfs_write_congestion, &wait,
+				TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 		if (bdi_write_congested(bdi)) {
 			if (signalled())
 				ret = -ERESTARTSYS;
Index: GIT-warnings/net/sunrpc/sched.c
===================================================================
--- GIT-warnings.orig/net/sunrpc/sched.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/net/sunrpc/sched.c	2005-12-21 16:22:11.000000000 +1100
@@ -659,7 +659,7 @@ static int __rpc_execute(struct rpc_task
 		/* Note: Caller should be using rpc_clnt_sigmask() */
 		status = out_of_line_wait_on_bit(&task->tk_runstate,
 				RPC_TASK_QUEUED, rpc_wait_bit_interruptible,
-				TASK_INTERRUPTIBLE);
+				TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 		if (status == -ERESTARTSYS) {
 			/*
 			 * When a sync task receives a signal, it exits with
Index: GIT-warnings/net/sunrpc/svcsock.c
===================================================================
--- GIT-warnings.orig/net/sunrpc/svcsock.c	2005-12-21 16:22:09.000000000 +1100
+++ GIT-warnings/net/sunrpc/svcsock.c	2005-12-21 16:22:11.000000000 +1100
@@ -1213,7 +1213,7 @@ svc_recv(struct svc_serv *serv, struct s
 		 * We have to be able to interrupt this wait
 		 * to bring down the daemons ...
 		 */
-		set_current_state(TASK_INTERRUPTIBLE);
+		set_current_state(TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE);
 		add_wait_queue(&rqstp->rq_wait, &wait);
 		spin_unlock_bh(&serv->sv_lock);
 

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2006-01-08  5:51 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-21  6:00 [PATCH] sched: Fix adverse effects of NFS client on interactive response Peter Williams
2005-12-21  6:09 ` Trond Myklebust
2005-12-21  6:32   ` Peter Williams
2005-12-21 13:21     ` Trond Myklebust
2005-12-21 13:36       ` Kyle Moffett
2005-12-21 13:40         ` Trond Myklebust
2005-12-22  2:26           ` Peter Williams
2005-12-22 22:08             ` Trond Myklebust
2005-12-22 22:33               ` Peter Williams
2005-12-22 22:59                 ` Trond Myklebust
2005-12-23  0:02                   ` Kyle Moffett
2005-12-23  0:25                     ` Trond Myklebust
2005-12-23  3:06                       ` Peter Williams
2005-12-23  9:39                         ` Trond Myklebust
2005-12-23 10:49                           ` Peter Williams
2005-12-23 12:51                             ` Trond Myklebust
2005-12-23 13:36                               ` Peter Williams
2006-01-02 12:09                                 ` Pekka Enberg
2005-12-23 19:07                           ` Lee Revell
2005-12-23 21:08                             ` Trond Myklebust
2005-12-23 21:17                               ` Lee Revell
2005-12-23 21:23                                 ` Trond Myklebust
2005-12-23 22:04                                   ` Lee Revell
2005-12-23 22:10                                     ` Trond Myklebust
2005-12-21 16:10         ` Horst von Brand
2005-12-21 20:36           ` Kyle Moffett
2005-12-21 22:59             ` Peter Williams
2005-12-21 16:11     ` Ingo Molnar
2005-12-21 22:49       ` Peter Williams
2006-01-02 11:01     ` Helge Hafting
2006-01-02 23:54       ` Peter Williams
2006-01-04  1:25         ` Peter Williams
2006-01-04  9:40           ` Marcelo Tosatti
2006-01-04 12:18             ` Con Kolivas
2006-01-04 10:31               ` Marcelo Tosatti
2006-01-04 21:51           ` Peter Williams
2006-01-05  6:31             ` Mike Galbraith
2006-01-05 11:31               ` Peter Williams
2006-01-05 14:31                 ` Mike Galbraith
2006-01-05 23:13                   ` Peter Williams
2006-01-05 23:33                     ` Con Kolivas
2006-01-06  0:02                       ` Peter Williams
2006-01-06  0:08                         ` Con Kolivas
2006-01-06  0:40                           ` Peter Williams
2006-01-06  7:39                     ` Mike Galbraith
2006-01-07  1:11                       ` Peter Williams
2006-01-07  5:27                         ` Mike Galbraith
2006-01-07  6:34                           ` Peter Williams
2006-01-07  8:54                             ` Mike Galbraith
2006-01-07 23:40                               ` Peter Williams
2006-01-08  5:51                                 ` Mike Galbraith
2006-01-07  9:30                           ` Con Kolivas
2006-01-07 10:23                             ` Mike Galbraith
2006-01-07 23:31                             ` Peter Williams
2006-01-08  0:38                               ` Con Kolivas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).