2005-11-15 01:54:39

by NeilBrown

[permalink] [raw]
Subject: [PATCH kNFSd ] Make sure nfsd doesn't hog a cpu forever.

Against 2.6.14-mm2, or 2.6.15-rc1
### Comments for Changeset

Being kernel-threads, nfsd servers don't get pre-empted (depending on
CONIG). 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 <[email protected]>

### Diffstat output
./net/sunrpc/svcsock.c | 1 +
1 file changed, 1 insertion(+)

diff ./net/sunrpc/svcsock.c~current~ ./net/sunrpc/svcsock.c
--- ./net/sunrpc/svcsock.c~current~ 2005-11-15 10:24:52.000000000 +1100
+++ ./net/sunrpc/svcsock.c 2005-11-15 10:24:52.000000000 +1100
@@ -1181,6 +1181,7 @@ svc_recv(struct svc_serv *serv, struct s
arg->tail[0].iov_len = 0;

try_to_freeze();
+ cond_resched();
if (signalled())
return -EINTR;



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2005-11-15 14:33:45

by Carlos Carvalho

[permalink] [raw]
Subject: Re: [PATCH kNFSd ] Make sure nfsd doesn't hog a cpu forever.

NeilBrown ([email protected]) wrote on 15 November 2005 12:54:
>Against 2.6.14-mm2, or 2.6.15-rc1
>### Comments for Changeset
>
>Being kernel-threads, nfsd servers don't get pre-empted (depending on
>CONIG). 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.

Yes!!!

This happens rather frequently here. I tried to put the nfsd threads
at nice 19 but it helped only a little and disturbs the other clients
too...

Could this be done for 2.4 also?


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs