All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Bryan Donlan <bdonlan@gmail.com>
Cc: Rajat Jain <Rajat.Jain@infogain.com>, loody <miloody@gmail.com>,
	linux-kernel@vger.kernel.org,
	Kernel Newbies <kernelnewbies@nl.linux.org>
Subject: Re: why kernel implement "udelay" by cpu instructions?
Date: Wed, 04 Nov 2009 09:16:57 -0500	[thread overview]
Message-ID: <4AF18CD9.40201@redhat.com> (raw)
In-Reply-To: <3e8340490911032136x56696cc3u3b6f3b1e5d132324@mail.gmail.com>

On 11/04/2009 12:36 AM, Bryan Donlan wrote:

> I thought hrtimers allow higher-precision wakeups these days?
> Of course, if you only want to sleep for a few microseconds, the
> context switch might take longer than you want to sleep...

Also, you may not be in a context where you can schedule.

Sometimes drivers need to implement a small delay (to wait
for something on the device) while holding a spinlock or
while interrupts are disabled.

-- 
All rights reversed.

      parent reply	other threads:[~2009-11-04 14:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  3:13 why kernel implement "udelay" by cpu instructions? loody
2009-11-02  4:45 ` Rik van Riel
2009-11-04  2:19   ` loody
2009-11-04  5:01     ` Rajat Jain
2009-11-04  5:36       ` Bryan Donlan
2009-11-04  5:45         ` Rajat Jain
2009-11-04 14:16         ` Rik van Riel [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=4AF18CD9.40201@redhat.com \
    --to=riel@redhat.com \
    --cc=Rajat.Jain@infogain.com \
    --cc=bdonlan@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miloody@gmail.com \
    /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.