public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: matthieu castet <castet.matthieu@free.fr>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: msleep_interruptible vs msleep
Date: Mon, 4 Sep 2006 21:38:26 +0200	[thread overview]
Message-ID: <200609042138.26603.arnd@arndb.de> (raw)
In-Reply-To: <44FC7EAE.6020300@free.fr>

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 <><

      reply	other threads:[~2006-09-04 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04 19:29 msleep_interruptible vs msleep matthieu castet
2006-09-04 19:38 ` Arnd Bergmann [this message]

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=200609042138.26603.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=castet.matthieu@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    /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