lkml.org 
[lkml]   [2008]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectbetter msleep for drivers
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


\
 
 \ /
  Last update: 2008-05-11 13:05    [W:0.048 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site