lkml.org 
[lkml]   [2004]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] Use msleep_interruptible for therm_adt7467.c kernel thread
From
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
===== 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 */
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.063 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site