Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-04 Thread Oleg Nesterov
Sameer, I didn't notice this part yesterday. On 12/03, Sameer Nanda wrote: > > > @@ -406,7 +409,7 @@ void oom_kill_process(struct task_struct *p, gfp_t > > gfp_mask, int order, > > { > > struct task_struct *victim = p; > > struct task_struct *child; > > - struct

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-04 Thread Oleg Nesterov
Sameer, I didn't notice this part yesterday. On 12/03, Sameer Nanda wrote: @@ -406,7 +409,7 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, { struct task_struct *victim = p; struct task_struct *child; - struct task_struct *t = p; +

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Oleg Nesterov
On 12/03, Oleg Nesterov wrote: > > > > -static bool has_intersects_mems_allowed(struct task_struct *tsk, > > > +static bool has_intersects_mems_allowed(struct task_struct *start, > > Comment block needs to be fixed up due to variable name change from > > tsk to start. > > thanks again, I'll update

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Oleg Nesterov
On 12/03, Sameer Nanda wrote: > > Reviewed-by: Sameer Nanda Thanks! > > -static bool has_intersects_mems_allowed(struct task_struct *tsk, > > +static bool has_intersects_mems_allowed(struct task_struct *start, > Comment block needs to be fixed up due to variable name change from > tsk to start.

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Sameer Nanda
Thanks for helping get this fixed! Couple of comments below. On Mon, Dec 2, 2013 at 7:24 AM, Oleg Nesterov wrote: > 1. Change oom_kill.c to use for_each_thread() rather than the racy >while_each_thread() which can loop forever if we race with exit. > >Note also that most users were

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Sameer Nanda
Thanks for helping get this fixed! Couple of comments below. On Mon, Dec 2, 2013 at 7:24 AM, Oleg Nesterov o...@redhat.com wrote: 1. Change oom_kill.c to use for_each_thread() rather than the racy while_each_thread() which can loop forever if we race with exit. Note also that most

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Oleg Nesterov
On 12/03, Sameer Nanda wrote: Reviewed-by: Sameer Nanda sna...@chromium.org Thanks! -static bool has_intersects_mems_allowed(struct task_struct *tsk, +static bool has_intersects_mems_allowed(struct task_struct *start, Comment block needs to be fixed up due to variable name change from

Re: [PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-03 Thread Oleg Nesterov
On 12/03, Oleg Nesterov wrote: -static bool has_intersects_mems_allowed(struct task_struct *tsk, +static bool has_intersects_mems_allowed(struct task_struct *start, Comment block needs to be fixed up due to variable name change from tsk to start. thanks again, I'll update the patch.

[PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-02 Thread Oleg Nesterov
1. Change oom_kill.c to use for_each_thread() rather than the racy while_each_thread() which can loop forever if we race with exit. Note also that most users were buggy even if while_each_thread() was fine, the task can exit even _before_ rcu_read_lock(). Fortunately the new

[PATCH 2/2] oom_kill: change oom_kill.c to use for_each_thread()

2013-12-02 Thread Oleg Nesterov
1. Change oom_kill.c to use for_each_thread() rather than the racy while_each_thread() which can loop forever if we race with exit. Note also that most users were buggy even if while_each_thread() was fine, the task can exit even _before_ rcu_read_lock(). Fortunately the new