Skip to contentSkip to conversation

net/svcsock: replace schedule_timeout() with msleep()

PATCH In review [email protected] 1 participant 1 message Mar 6, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 net/svcsock: replace schedule_timeout() with msleep()

Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The code, as is, is not wrong; however I see two reasons to use msleep(): 1) consistency across the kernel; and 2) milliseconds are far more human-comprehensible than jiffies.

---

 kj-domen/net/sunrpc/svcsock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c~msleep-net_sunrpc_svcsock +2 -2
diff -puN net/sunrpc/svcsock.c~msleep-net_sunrpc_svcsock net/sunrpc/svcsock.c
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
+#include <linux/delay.h>
 #include <net/sock.h>
 #include <net/checksum.h>
 #include <net/ip.h>
@@ -1167,8 +1168,7 @@ svc_recv(struct svc_serv *serv, struct s
 	while (rqstp->rq_arghi < pages) {
 		struct page *p = alloc_page(GFP_KERNEL);
 		if (!p) {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(HZ/2);
+			msleep(500);
 			continue;
 		}
 		rqstp->rq_argpages[rqstp->rq_arghi++] = p;

_