lkml.org 
[lkml]   [2011]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] wait_event_freezekillable: use freezer_do_not_count/freezer_count
On Wed, 2 Nov 2011 18:53:27 +0100
Oleg Nesterov <oleg@redhat.com> wrote:

> fake_signal_wake_up() should not wake up the TASK_KILLABLE tasks,
> we are going to fix this. This means that wait_event_freezekillable()
> can't rely on wakeup from freezer. Reimplement it using
> freezer_do_not_count/freezer_count. This is not really nice, just
> a simple fix for now.
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---
>
> include/linux/freezer.h | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> --- a/include/linux/freezer.h
> +++ b/include/linux/freezer.h
> @@ -143,13 +143,9 @@ static inline void set_freezable_with_si
> #define wait_event_freezekillable(wq, condition) \
> ({ \
> int __retval; \
> - for (;;) { \
> - __retval = wait_event_killable(wq, \
> - (condition) || freezing(current)); \
> - if (__retval || (condition)) \
> - break; \
> - try_to_freeze(); \
> - } \
> + freezer_do_not_count(); \
> + __retval = wait_event_killable(wq, (condition)); \
> + freezer_count(); \
> __retval; \
> })
>
>

I'm not sure we really need this macro anymore since this is much
simpler. I could just move cifs back to using wait_event_killable and
simply wrap it in freezer_do_not_count/freezer_count (with some
comments to explain why we're doing that).

In any event, I plan to test this scheme out today and will let you
know whether it works...

Thanks,
--
Jeff Layton <jlayton@redhat.com>


\
 
 \ /
  Last update: 2011-11-03 11:45    [W:0.086 / U:24.888 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site