Messages in this thread | | | Date | Tue, 19 Nov 2013 09:25:48 +0100 | From | Peter Zijlstra <> | Subject | Re: [PATCH/RFC] wait_for_completion_timeout() considered harmful. |
| |
On Tue, Nov 19, 2013 at 10:44:38AM +1100, NeilBrown wrote: > We have loops that have > timeout = schedule_timeout(timeout) > in the middle and if we change the semantics of schedule_timeout() to round > up, those loops could wait quite a bit longer than expected.
Depends on what you expect; most of these functions have documentation that says they will sleep at least timeout amount of time.
schedule_timeout()'s version looks like:
* Make the current task sleep until @timeout jiffies have * elapsed.
Clearly it doesn't do that currently, so adding 1 will actually make it do what it says on the tin.
| |