lkml.org 
[lkml]   [2015]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Ques: [kernel/time/*] Is there any disadvantage in using usleep_range for more than 20ms delay ?
From
Date
Aniroop Mathur wrote:
> As in the kernel documentation, it is mentioned to use msleep for
> 10ms+ delay, I am confused whether there would be any disadvantage in
> using usleep_range for higher delays values because normally drivers
> have variety of delays used (2, 10, 20, 40, 100, 500 ms).
>
> So, could you please help to confirm that if we use usleep_range for
> inserting delays greater than 20 ms, would it be harmful or beneficial
> or does not make any difference at all ?

As the documentation told you, usleep_range() is likely to require
a separate interrupt, while msleep() is likely to round to some other,
already-scheduled interrupt. The former is possibly harmful regarding
CPU and power usage; you have to balance it against your need for
accuracy.

(And usleep_range() has a 32-bit nanosecond limit on 32-bit
architectures.)


Regards,
Clemens


\
 
 \ /
  Last update: 2015-12-08 10:21    [W:0.054 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site