public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: better msleep for drivers
Date: Sun, 11 May 2008 13:01:24 +0200	[thread overview]
Message-ID: <20080511110124.GA24187@basil.nowhere.org> (raw)

Thomas,

Someone asked if there is a msleep using hrtimers that is more accurate
than jiffies/msecs for external drivers. There is hrtimer nanosleep,
but it is currently not exported. It can be reimplemented using hrtimer_start
etc. which are exported, but that seems rather clumpsy.

Is there any reason such an obvious function is not exported? 

Ok I guess right now nobody in tree is using it. But that seems wrong.  
Perhaps we should have a (exported) usleep_blocking() wrapper or somesuch for 
that case?  

I suspect that a lot of drivers could make use of it. Just from grepping we 
have a lot of msleep(1)s in drivers and I suspect a lot of those would 
actually like to delay shorter than one jiffie. 

One argument against it would be that it makes them more difficult to test 
because behavior will differ between hrtimer enabled and disabled systems. 
Still longer term I suppose there's really no way around having accurate
sleep functions and it's probably better to start testing earlier than later.

Thoughts?

-Andi

             reply	other threads:[~2008-05-11 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 11:01 Andi Kleen [this message]
2008-05-11 13:43 ` better msleep for drivers Thomas Gleixner
2008-05-21 10:41   ` Pavel Machek
2008-05-21 15:24     ` Jeff Garzik
2008-05-21 19:01       ` Pavel Machek

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=20080511110124.GA24187@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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