Re: [PATCH/RFC] wait_for_completion_timeout() considered harmful.

From: Peter Zijlstra
Date: Tue Nov 19 2013 - 03:26:01 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/