From: Herbert Xu <herbert@gondor.apana.org.au>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: akpm@osdl.org, benh@kernel.crashing.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
mdz@canonical.com, janitor@sternwelten.at
Subject: Re: [PATCH] Use msleep_interruptible for therm_adt7467.c kernel thread
Date: Wed, 29 Sep 2004 11:58:27 +1000 [thread overview]
Message-ID: <20040929015827.GA26337@gondor.apana.org.au> (raw)
In-Reply-To: <1096289501.9930.19.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
On Mon, Sep 27, 2004 at 01:51:42PM +0100, Alan Cox wrote:
> On Llu, 2004-09-27 at 11:25, Herbert Xu wrote:
> > The continue is just paranoia in case something relies on the sleep
> > to take 2 seconds or more.
>
> If the signal occurs then you'll spin for 2 seconds because the signal
> is still waiting to be serviced. This therefore looks broken
Yes you're right. However I'd say that msleep_interruptible should
mirror the behaviour of schedule_timeout and at least sleep once.
BTW, msleep_interruptible() is white-space damaged. Can someone please
fix it up?
> A more interesting question is why this isn't being driven off a
> timer ?
It probably could if the stuff afterwards doesn't sleep.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 507 bytes --]
===== kernel/timer.c 1.93 vs edited =====
--- 1.93/kernel/timer.c 2004-09-17 17:07:06 +10:00
+++ edited/kernel/timer.c 2004-09-29 11:48:06 +10:00
@@ -1626,10 +1626,10 @@
{
unsigned long timeout = msecs_to_jiffies(msecs);
- while (timeout && !signal_pending(current)) {
+ do {
set_current_state(TASK_INTERRUPTIBLE);
timeout = schedule_timeout(timeout);
- }
+ } while (timeout && !signal_pending(current));
return jiffies_to_msecs(timeout);
}
next prev parent reply other threads:[~2004-09-29 1:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-27 10:25 Herbert Xu
2004-09-27 12:51 ` Alan Cox
2004-09-29 1:58 ` Herbert Xu [this message]
2004-09-29 1:24 ` Alan Cox
2004-09-29 4:12 ` Benjamin Herrenschmidt
2004-09-29 4:13 ` Benjamin Herrenschmidt
2004-09-30 4:40 ` Andrew Morton
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=20040929015827.GA26337@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=benh@kernel.crashing.org \
--cc=janitor@sternwelten.at \
--cc=linux-kernel@vger.kernel.org \
--cc=mdz@canonical.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
all inboxes | Powered by JetHome®