Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-06 Thread Oleg Nesterov
Hi Tejun, On 06/05, Tejun Heo wrote: > > Heh, yeah, this looks good to me and a lot better than trying to do > the same thing over and over again and ending up with subtle > differences. Yes, this is the goal. Of course we could fix wait_event_timout() and wait_event_interruptible_timeout() witho

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-05 Thread Tejun Heo
Hello, Oleg. On Wed, Jun 05, 2013 at 09:07:23PM +0200, Oleg Nesterov wrote: > And in fact, perhaps we can implement wait_event_common() and avoid the > code duplications? > > #define __wait_no_timeout(timeout) \ > (__builtin_constant_p(timeout) && (timeout) == > MAX_SCHE

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-05 Thread Oleg Nesterov
On 06/05, Oleg Nesterov wrote: > > I think that wait_eveint_timeout(wq, COND, 0) should return !!(COND). > But it doesn't, for example wait_event_timeout(wq, true, 0) == 0, this > doesn'tlook right to me. > > And, this is off-topic, but wait_eveint_timeout/__wait_eveint_timeout > do not match wait_

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-05 Thread Oleg Nesterov
On 06/05, Imre Deak wrote: > > On Wed, 2013-06-05 at 00:35 +0300, Imre Deak wrote: > > On Tue, 2013-06-04 at 21:28 +0200, Oleg Nesterov wrote: > > > > > > Shouldn't we also change wait_event_timeout() ? Say, > > > > > > #define wait_event_timeout(wq, condition, timeout) > >

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-04 Thread Imre Deak
On Wed, 2013-06-05 at 00:35 +0300, Imre Deak wrote: > On Tue, 2013-06-04 at 21:28 +0200, Oleg Nesterov wrote: > > Hello, > > > > Just noticed this commit... > > > > commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e > > Author: Imre Deak > > Date: Fri May 24 15:55:09 2013 -0700 > > > > Many

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-04 Thread Imre Deak
On Tue, 2013-06-04 at 21:28 +0200, Oleg Nesterov wrote: > Hello, > > Just noticed this commit... > > commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e > Author: Imre Deak > Date: Fri May 24 15:55:09 2013 -0700 > > Many callers of the wait_event_timeout() and > wait_event_interruptible_t

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-06-04 Thread Oleg Nesterov
Hello, Just noticed this commit... commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e Author: Imre Deak Date: Fri May 24 15:55:09 2013 -0700 Many callers of the wait_event_timeout() and wait_event_interruptible_timeout() expect that the return value will be positive if the specified

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-08 Thread Imre Deak
On Tue, 2013-05-07 at 16:12 -0700, Andrew Morton wrote: > On Thu, 2 May 2013 11:36:56 +0200 Daniel Vetter > wrote: > > > On Thu, May 2, 2013 at 10:58 AM, Imre Deak wrote: > > > Many callers of the wait_event_timeout() and > > > wait_event_interruptible_timeout() expect that the return value wil

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-07 Thread Andrew Morton
On Thu, 2 May 2013 11:36:56 +0200 Daniel Vetter wrote: > On Thu, May 2, 2013 at 10:58 AM, Imre Deak wrote: > > Many callers of the wait_event_timeout() and > > wait_event_interruptible_timeout() expect that the return value will be > > positive if the specified condition becomes true before the

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Imre Deak
On Thu, 2013-05-02 at 14:35 +0200, Jens Axboe wrote: > On Thu, May 02 2013, David Howells wrote: > > Imre Deak wrote: > > > > > Many callers of the wait_event_timeout() and > > > wait_event_interruptible_timeout() expect that the return value will be > > > positive if the specified condition beco

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Daniel Vetter
On Thu, May 2, 2013 at 3:56 PM, Imre Deak wrote: > On Thu, 2013-05-02 at 14:54 +0200, Jens Axboe wrote: >> On Thu, May 02 2013, Imre Deak wrote: >> > On Thu, 2013-05-02 at 14:23 +0200, Jens Axboe wrote: >> > > On Thu, May 02 2013, Daniel Vetter wrote: >> > > > On Thu, May 2, 2013 at 12:29 PM, Davi

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Imre Deak
On Thu, 2013-05-02 at 14:54 +0200, Jens Axboe wrote: > On Thu, May 02 2013, Imre Deak wrote: > > On Thu, 2013-05-02 at 14:23 +0200, Jens Axboe wrote: > > > On Thu, May 02 2013, Daniel Vetter wrote: > > > > On Thu, May 2, 2013 at 12:29 PM, David Howells > > > > wrote: > > > > >> Fix this by return

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Jens Axboe
On Thu, May 02 2013, Imre Deak wrote: > On Thu, 2013-05-02 at 14:23 +0200, Jens Axboe wrote: > > On Thu, May 02 2013, Daniel Vetter wrote: > > > On Thu, May 2, 2013 at 12:29 PM, David Howells > > > wrote: > > > >> Fix this by returning at least 1 if the condition becomes true. This > > > >> seman

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Jens Axboe
On Thu, May 02 2013, David Howells wrote: > Imre Deak wrote: > > > Many callers of the wait_event_timeout() and > > wait_event_interruptible_timeout() expect that the return value will be > > positive if the specified condition becomes true before the timeout > > elapses. However, at the moment t

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Imre Deak
On Thu, 2013-05-02 at 14:23 +0200, Jens Axboe wrote: > On Thu, May 02 2013, Daniel Vetter wrote: > > On Thu, May 2, 2013 at 12:29 PM, David Howells wrote: > > >> Fix this by returning at least 1 if the condition becomes true. This > > >> semantic is in line with what wait_for_condition_timeout() d

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread David Howells
Imre Deak wrote: > Many callers of the wait_event_timeout() and > wait_event_interruptible_timeout() expect that the return value will be > positive if the specified condition becomes true before the timeout > elapses. However, at the moment this isn't guaranteed. If the wake-up > handler is dela

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread David Howells
Jens Axboe wrote: > IMHO, the change definitely makes sense. Yeah... I think I agree. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Jens Axboe
On Thu, May 02 2013, Daniel Vetter wrote: > On Thu, May 2, 2013 at 12:29 PM, David Howells wrote: > >> Fix this by returning at least 1 if the condition becomes true. This > >> semantic is in line with what wait_for_condition_timeout() does; see > >> commit bb10ed09 - "sched: fix wait_for_completi

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Daniel Vetter
On Thu, May 2, 2013 at 12:29 PM, David Howells wrote: >> Fix this by returning at least 1 if the condition becomes true. This >> semantic is in line with what wait_for_condition_timeout() does; see >> commit bb10ed09 - "sched: fix wait_for_completion_timeout() spurious >> failure under heavy load"

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Imre Deak
On Thu, 2013-05-02 at 11:29 +0100, David Howells wrote: > Imre Deak wrote: > > > Many callers of the wait_event_timeout() and > > wait_event_interruptible_timeout() expect that the return value will be > > positive if the specified condition becomes true before the timeout > > elapses. However, a

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread David Howells
Imre Deak wrote: > Many callers of the wait_event_timeout() and > wait_event_interruptible_timeout() expect that the return value will be > positive if the specified condition becomes true before the timeout > elapses. However, at the moment this isn't guaranteed. If the wake-up > handler is dela

Re: [PATCH] wait: fix false timeouts when using wait_event_timeout()

2013-05-02 Thread Daniel Vetter
On Thu, May 2, 2013 at 10:58 AM, Imre Deak wrote: > Many callers of the wait_event_timeout() and > wait_event_interruptible_timeout() expect that the return value will be > positive if the specified condition becomes true before the timeout > elapses. However, at the moment this isn't guaranteed.