Skip to contentSkip to conversation

Make sure nfsd doesn't hog a cpu forever.

PATCH In review NeilBrown 2 participants 2 messages Nov 15, 2005 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20051115125307.9288.patches@notabene

NeilBrown

author
#1 lore raw

PATCH 1/1 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.

### Diffstat output

 ./net/sunrpc/svcsock.c |    1 +
 1 file changed, 1 insertion(+)
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c~current~ +1 -0
diff ./net/sunrpc/svcsock.c~current~ ./net/sunrpc/svcsock.c
@@ -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

#2 lore raw

NeilBrown ([email protected]) wrote on 15 November 2005 12:54:

Quoted 10 lines

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