Messages in this thread | | | Date | Tue, 19 Nov 2013 09:29:13 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH/RFC] wait_for_completion_timeout() considered harmful. |
| |
On Mon, Nov 18, 2013 at 05:49:02PM -0700, Jonathan Corbet wrote: > On Tue, 19 Nov 2013 00:42:09 +0100 > Peter Zijlstra <peterz@infradead.org> wrote: > > > I briefly talked to Thomas about this earlier today and we need to fix > > this at a lower level -- the quick 'n dirty solution is to add 1 jiffy > > down in the timer-wheel when we enqueue these things. > > That can lead to situations like the one I encountered years ago where > msleep(1) would snooze for 20ms.
No, for up to 20ms, since you get part of the first jiffy, which was the whole problem (assuming we're talking HZ=100 here).
> I didn't get much love for my idea of > switching msleep() to hrtimers back then, but I still think it might be be > better to provide the resolution that the interface appears to promise.
It would actually make more sense to use hrtimers here than it does to use the old timers since hrtimers has much better gurantees but also because the timer is guaranteed to fire.
The use case where the old timers really beat hrtimers hands down is for timeout timers that never actually fire.
| |