[PATCH] Use msleep_interruptible for therm_adt7467.c kernel thread
From: Herbert Xu
Date: Mon Sep 27 2004 - 05:27:26 EST
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@xxxxxxxxxxxxxxxxxxx>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
===== 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 */