From: domen@coderock.org
To: davem@redhat.com
Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com
Subject: [patch 3/5] net/svcsock: replace schedule_timeout() with msleep()
Date: Sun, 06 Mar 2005 23:21:14 +0100 [thread overview]
Message-ID: <20050306222115.2A8E21EC90@trashy.coderock.org> (raw)
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.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
kj-domen/net/sunrpc/svcsock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -puN net/sunrpc/svcsock.c~msleep-net_sunrpc_svcsock net/sunrpc/svcsock.c
--- kj/net/sunrpc/svcsock.c~msleep-net_sunrpc_svcsock 2005-03-05 16:10:59.000000000 +0100
+++ kj-domen/net/sunrpc/svcsock.c 2005-03-05 16:10:59.000000000 +0100
@@ -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;
_
reply other threads:[~2005-03-06 22:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050306222115.2A8E21EC90@trashy.coderock.org \
--to=domen@coderock.org \
--cc=davem@redhat.com \
--cc=nacc@us.ibm.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).