aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-11-15 03:09:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-15 11:59:19 -0500
commit1887b93529410633b5529a7c2d304897dbed5b3e (patch)
treebb51359d16e40503dc8faa56bd429311d3514bda /net/sunrpc/svcsock.c
parentfa63b229829e73361900183bc1ae21b71b6c2dae (diff)
[PATCH] knfsd: make sure nfsd doesn't hog a cpu forever
Being kernel-threads, nfsd servers don't get pre-empted (depending on CONFIG). If there is a steady stream of NFS requests that can be served from cache, an nfsd thread may hold on to a cpu indefinitely, which isn't very friendly. So it is good to have a cond_resched in there (just before looking for a new request to serve), to make sure we play nice. Signed-off-by: Neil Brown <neilb@suse.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index e50e7cf43737..c6a51911e71e 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1178,6 +1178,7 @@ svc_recv(struct svc_serv *serv, struct svc_rqst *rqstp, long timeout)
1178 arg->tail[0].iov_len = 0; 1178 arg->tail[0].iov_len = 0;
1179 1179
1180 try_to_freeze(); 1180 try_to_freeze();
1181 cond_resched();
1181 if (signalled()) 1182 if (signalled())
1182 return -EINTR; 1183 return -EINTR;
1183 1184