Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread NeilBrown
On Wed, 30 Apr 2014 09:31:54 +0200 Peter Zijlstra wrote: > On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: > > If you think it is a good cleanup I'll post a proper patch with all the > > right > > Cc:s. > > Yeah, its a good cleanup. Thanks! > > > +static inline int > >

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 09:31:54AM +0200, Peter Zijlstra wrote: > On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: > > If you think it is a good cleanup I'll post a proper patch with all the > > right > > Cc:s. > > Yeah, its a good cleanup. Thanks! Also, please add Oleg to the Cc, he

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: > If you think it is a good cleanup I'll post a proper patch with all the right > Cc:s. Yeah, its a good cleanup. Thanks! > +static inline int > +wait_on_bit(void *word, int bit, unsigned mode) > +{ > + if (!test_bit(bit, word)) > +

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: If you think it is a good cleanup I'll post a proper patch with all the right Cc:s. Yeah, its a good cleanup. Thanks! +static inline int +wait_on_bit(void *word, int bit, unsigned mode) +{ + if (!test_bit(bit, word)) +

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread Peter Zijlstra
On Wed, Apr 30, 2014 at 09:31:54AM +0200, Peter Zijlstra wrote: On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: If you think it is a good cleanup I'll post a proper patch with all the right Cc:s. Yeah, its a good cleanup. Thanks! Also, please add Oleg to the Cc, he was

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-30 Thread NeilBrown
On Wed, 30 Apr 2014 09:31:54 +0200 Peter Zijlstra pet...@infradead.org wrote: On Wed, Apr 30, 2014 at 12:29:26PM +1000, NeilBrown wrote: If you think it is a good cleanup I'll post a proper patch with all the right Cc:s. Yeah, its a good cleanup. Thanks! +static inline int

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
On Tue, 29 Apr 2014 12:32:17 +0200 Peter Zijlstra wrote: > So I'm sure I'm not getting it; but why is all the wait_bit crap so > entirely different from the normal wait stuff? > > Surely something like: > > wait_event_timeout(, test_bit(bit, word), timeout); > > Is pretty much the same,

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
On Tue, 29 Apr 2014 12:32:17 +0200 Peter Zijlstra wrote: > On Tue, Apr 29, 2014 at 07:44:06PM +1000, NeilBrown wrote: > > > > > > It is currently not possible for various wait_on_bit functions to > > implement a timeout. > > While the "action" function that is called to do the waiting could >

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 07:44:06PM +1000, NeilBrown wrote: > > > It is currently not possible for various wait_on_bit functions to > implement a timeout. > While the "action" function that is called to do the waiting could > certainly use schedule_timeout(), there is no way to carry forward the

[PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
It is currently not possible for various wait_on_bit functions to implement a timeout. While the "action" function that is called to do the waiting could certainly use schedule_timeout(), there is no way to carry forward the remaining timeout after a false wake-up. As false-wakeups a clearly

[PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
It is currently not possible for various wait_on_bit functions to implement a timeout. While the action function that is called to do the waiting could certainly use schedule_timeout(), there is no way to carry forward the remaining timeout after a false wake-up. As false-wakeups a clearly

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread Peter Zijlstra
On Tue, Apr 29, 2014 at 07:44:06PM +1000, NeilBrown wrote: It is currently not possible for various wait_on_bit functions to implement a timeout. While the action function that is called to do the waiting could certainly use schedule_timeout(), there is no way to carry forward the

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
On Tue, 29 Apr 2014 12:32:17 +0200 Peter Zijlstra pet...@infradead.org wrote: On Tue, Apr 29, 2014 at 07:44:06PM +1000, NeilBrown wrote: It is currently not possible for various wait_on_bit functions to implement a timeout. While the action function that is called to do the waiting

Re: [PATCH/RFC] SCHED: allow wait_on_bit functions to support a timeout.

2014-04-29 Thread NeilBrown
On Tue, 29 Apr 2014 12:32:17 +0200 Peter Zijlstra pet...@infradead.org wrote: So I'm sure I'm not getting it; but why is all the wait_bit crap so entirely different from the normal wait stuff? Surely something like: wait_event_timeout(wq, test_bit(bit, word), timeout); Is pretty