Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-31 Thread Hugo Lefeuvre
Hi, > I agree, it is probably better to use freezable_schedule() for all freeze > related wait APIs, and keep it consistent. Your analysis is convincing. I have submitted a new patchset which migrates the wait api to freezable_schedule() and splits the changes from the previous patch. regards,

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-22 Thread Joel Fernandes
On Sat, Jan 19, 2019 at 11:29:12AM +0100, Hugo Lefeuvre wrote: > > > as far as I understand this code, freezable_schedule() avoids blocking the > > > freezer during the schedule() call, but in the end try_to_freeze() is > > > still > > > called so the result is the same, right? > > > I wonder why

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-21 Thread Rafael J. Wysocki
On Friday, January 18, 2019 5:04:50 PM CET Peter Zijlstra wrote: > On Fri, Jan 18, 2019 at 10:19:41AM -0500, Joel Fernandes wrote: > > You should document the variable names in the header comments. > > > > Also, this new API appears to conflict with definition of 'freezable' in > >

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-19 Thread Hugo Lefeuvre
> > as far as I understand this code, freezable_schedule() avoids blocking the > > freezer during the schedule() call, but in the end try_to_freeze() is still > > called so the result is the same, right? > > I wonder why wait_event_freezable is not calling freezable_schedule(). > > It could be

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Joel Fernandes
On Fri, Jan 18, 2019 at 06:08:01PM +0100, Hugo Lefeuvre wrote: [...] > > > +/* > > > + * like wait_event_hrtimeout() -- except it uses TASK_INTERRUPTIBLE to > > > avoid > > > + * increasing load and is freezable. > > > + */ > > > +#define wait_event_freezable_hrtimeout(wq_head, condition,

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Peter Zijlstra
On Fri, Jan 18, 2019 at 10:19:41AM -0500, Joel Fernandes wrote: > You should document the variable names in the header comments. > > Also, this new API appears to conflict with definition of 'freezable' in > wait_event_freezable I think, > > wait_event_freezable - sleep or freeze until condition

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Hugo Lefeuvre
Hi Joel, Thanks for your review. > I believe these should be 2 patches. In the first patch you introduce the > new API, in the second one you would simplify the VSOC driver. > > In fact, in one part of the patch you are using wait_event_freezable which > already exists so that's unrelated to

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-18 Thread Joel Fernandes
Hi Hugo, On Thu, Jan 17, 2019 at 11:41:35PM +0100, Hugo Lefeuvre wrote: > introduce wait_event_freezable_hrtimeout, an interruptible and freezable > version of wait_event_hrtimeout. > > simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this > newly added helper and remove

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-17 Thread Hugo Lefeuvre
Hi Greg, > > introduce wait_event_freezable_hrtimeout, an interruptible and freezable > > version of wait_event_hrtimeout. > > > > simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this > > newly added helper and remove useless includes. > > > > Signed-off-by: Hugo Lefeuvre

Re: [PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-17 Thread Greg Kroah-Hartman
On Thu, Jan 17, 2019 at 11:41:35PM +0100, Hugo Lefeuvre wrote: > introduce wait_event_freezable_hrtimeout, an interruptible and freezable > version of wait_event_hrtimeout. > > simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this > newly added helper and remove useless

[PATCH] sched/wait: introduce wait_event_freezable_hrtimeout

2019-01-17 Thread Hugo Lefeuvre
introduce wait_event_freezable_hrtimeout, an interruptible and freezable version of wait_event_hrtimeout. simplify handle_vsoc_cond_wait (drivers/staging/android/vsoc.c) using this newly added helper and remove useless includes. Signed-off-by: Hugo Lefeuvre --- drivers/staging/android/vsoc.c |