public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use msleep_interruptible for therm_adt7467.c kernel thread
@ 2004-09-27 10:25 Herbert Xu
  2004-09-27 12:51 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2004-09-27 10:25 UTC (permalink / raw)
  To: akpm, benh, Linux Kernel Mailing List; +Cc: mdz

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Hi:

Using msleep() in a kernel thread causes it to show up in the D state
and contribute towards the system load average.  The following patch
converts it to msleep_interruptible().

The continue is just paranoia in case something relies on the sleep
to take 2 seconds or more.

This bug was reported at

https://bugzilla.no-name-yet.com/show_bug.cgi?id=1804

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

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: 366 bytes --]

===== drivers/macintosh/therm_adt746x.c 1.5 vs edited =====
--- 1.5/drivers/macintosh/therm_adt746x.c	2004-09-23 06:31:14 +10:00
+++ edited/drivers/macintosh/therm_adt746x.c	2004-09-27 20:24:58 +10:00
@@ -246,7 +246,8 @@
 
 	while(monitor_running)
 	{
-		msleep(2000);
+		if (msleep_interruptible(2000))
+			continue;
 
 		/* Check status */
 		/* local   : chip */

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-09-30  1:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-27 10:25 [PATCH] Use msleep_interruptible for therm_adt7467.c kernel thread Herbert Xu
2004-09-27 12:51 ` Alan Cox
2004-09-29  1:58   ` Herbert Xu
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox