lkml.org 
[lkml]   [2013]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 13/33] wait: add wait_event_hrtimeout()
    On Thu, Mar 21, 2013 at 09:35:34AM -0700, Kent Overstreet wrote:
    > Analagous to wait_event_timeout() and friends, this adds
    > wait_event_hrtimeout() and wait_event_interruptible_hrtimeout().
    >
    > Note that unlike the versions that use regular timers, these don't return
    > the amount of time remaining when they return - instead, they return 0 or
    > -ETIME if they timed out. because I was uncomfortable with the semantics
    > of doing it the other way (that I could get it right, anyways).
    >
    > If the timer expires, there's no real guarantee that expire_time -
    > current_time would be <= 0 - due to timer slack certainly, and I'm not
    > sure I want to know the implications of the different clock bases in
    > hrtimers.
    >
    > If the timer does expire and the code calculates that the time remaining
    > is nonnegative, that could be even worse if the calling code then reuses
    > that timeout. Probably safer to just return 0 then, but I could imagine
    > weird bugs or at least unintended behaviour arising from that too.
    >
    > I came to the conclusion that if other users end up actually needing the
    > amount of time remaining, the sanest thing to do would be to create a
    > version that uses absolute timeouts instead of relative.

    Reviewed-by: "Theodore Ts'o" <tytso@mit.edu>



    \
     
     \ /
      Last update: 2013-04-02 04:01    [W:4.129 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site