[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200609042138.26603.arnd@arndb.de>
Date: Mon, 4 Sep 2006 21:38:26 +0200
From: Arnd Bergmann <arnd@...db.de>
To: matthieu castet <castet.matthieu@...e.fr>
Cc: Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: msleep_interruptible vs msleep
Am Monday 04 September 2006 21:29 schrieb matthieu castet:
>
> But why if I have a kernel thread that do [1] :
>
> while (true) {
> Do some stuff
> msleep(1000)
> }
>
> the load average is high (near 100%).
>
> and if I use msleep_interruptible the load average is normal.
These are the traditional semantics of incorruptible vs. noninterruptible
sleep. A process that sleep noninterruptible contributes to the load
average but does not consume actual CPU cycles.
I guess you can take that as a hint that the code you're describing
above is a bad thing to do.
> Does the same applies to wait_event_timeout vs
> wait_event_interruptible_timeout ?
yes.
Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists