From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>
Subject: [PATCH][RESEND] Fix msleep to sleep _at_least_ the requested amount
Date: Mon, 25 Oct 2004 10:19:48 +1000 [thread overview]
Message-ID: <1098663439.16132.2.camel@gaston> (raw)
In-Reply-To: <Pine.LNX.4.58.0410221552320.2101@ppc970.osdl.org>
Hi Linus !
You "agreed" but didn't apply the patch on the last message ... so here
it is again.
Makes sure msleep() sleeps at least the amount provided, since
schedule_timeout() doesn't guarantee a full jiffy.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
===== kernel/timer.c 1.100 vs edited =====
--- 1.100/kernel/timer.c 2004-10-19 19:40:28 +10:00
+++ edited/kernel/timer.c 2004-10-23 09:16:10 +10:00
@@ -1605,7 +1605,7 @@
*/
void msleep(unsigned int msecs)
{
- unsigned long timeout = msecs_to_jiffies(msecs);
+ unsigned long timeout = msecs_to_jiffies(msecs) + 1;
while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
@@ -1621,7 +1621,7 @@
*/
unsigned long msleep_interruptible(unsigned int msecs)
{
- unsigned long timeout = msecs_to_jiffies(msecs);
+ unsigned long timeout = msecs_to_jiffies(msecs) + 1;
while (timeout && !signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);
prev parent reply other threads:[~2004-10-25 0:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200410221906.i9MJ63Ai022889@hera.kernel.org>
2004-10-22 22:36 ` [PATCH] pmac_cpufreq msleep cleanup/fixes Benjamin Herrenschmidt
2004-10-22 22:53 ` Linus Torvalds
2004-10-22 23:17 ` Benjamin Herrenschmidt
2004-10-22 23:43 ` Nishanth Aravamudan
2004-10-23 0:33 ` Paul Mackerras
2004-10-22 23:51 ` Linus Torvalds
2004-10-25 0:19 ` Benjamin Herrenschmidt [this message]
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=1098663439.16132.2.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=torvalds@osdl.org \
/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