All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: "Eibach, Dirk" <Eibach@gdsys.de>
Cc: Jiri Slaby <jirislaby@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: msleep() an load average
Date: Wed, 04 May 2011 16:30:58 +0200	[thread overview]
Message-ID: <4DC16322.2090607@ladisch.de> (raw)
In-Reply-To: <48D3D52125C49B43AE880038E2E5314BB5BE9E@SRV101.gdsys.de>

Eibach, Dirk wrote:
> > Uninterruptible sleeps count as I/O load.
> 
> Is there any practical reason behind this or was it just an igenious
> invention to annoy those smug userspace developers?

Historically, uninterruptible sleeps were the best way to detect I/O
load.  Furthermore, a process that is doing I/O is very likely to
continue running soon, while other sleeps are more likely to indicate
that the process is waiting for some event to wake it up to begin doing
something, so this better predicts CPU load.  Finally, a busy device is
likely to prevent other programs from running well, so it makes sense
to count this against the load.

msleep() is commonly used to handle device communication delays, which
is essentially the same case as waiting for disk I/O.  It might be
possible to introduce some new flags or functions to allow long
uninterruptible sleeps that do not affect the load, but this has not
been necessary so far because knowledge of this quirk of the load
heuristic is necessary for every great kernel hacker.  ;-)


Regards,
Clemens

  reply	other threads:[~2011-05-04 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 12:11 msleep() an load average Eibach, Dirk
2011-05-04 13:37 ` Jiri Slaby
2011-05-04 13:54   ` Eibach, Dirk
2011-05-04 14:30     ` Clemens Ladisch [this message]
2011-05-04 14:47       ` Eibach, Dirk
2011-05-04 13:47 ` Clemens Ladisch
2011-05-04 14:04   ` Eibach, Dirk

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=4DC16322.2090607@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=Eibach@gdsys.de \
    --cc=jirislaby@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.