Re: [PATCH V1] oom: avoid selecting threads sharing mm with init

2013-10-01 Thread David Rientjes
On Fri, 27 Sep 2013, Ming Liu wrote: > I might mislead you, when I talked about init, I meant the pid 1 process but > not the idle, and isn't the idle a kthread and has not this risk getting > killed by oom? You can disqualify for p->mm == &init_mm, but the oom killer has been rewritten since 2.

Re: [PATCH V1] oom: avoid selecting threads sharing mm with init

2013-09-26 Thread Ming Liu
On 09/27/2013 02:44 AM, David Rientjes wrote: On Thu, 26 Sep 2013, Ming Liu wrote: diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 314e9d2..7e50a95 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -113,11 +113,22 @@ struct task_struct *find_lock_task_mm(struct task_struct *p) static bool o

Re: [PATCH V1] oom: avoid selecting threads sharing mm with init

2013-09-26 Thread David Rientjes
On Thu, 26 Sep 2013, Ming Liu wrote: > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 314e9d2..7e50a95 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -113,11 +113,22 @@ struct task_struct *find_lock_task_mm(struct > task_struct *p) > static bool oom_unkillable_task(struct task_struc

[PATCH V1] oom: avoid selecting threads sharing mm with init

2013-09-26 Thread Ming Liu
It won't help free memory for killing tasks sharing mm with init, we should skip them in oom_unkillable_task(), or we may risk init process getting killed because after selecting a task to kill, the oom killer iterates all processes and kills all other user threads that share the same mm_struct in