Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-07-19 Thread Michal Hocko
On Tue 19-07-16 16:27:59, Andrew Morton wrote: > On Tue, 19 Jul 2016 14:05:39 +0200 Michal Hocko wrote: > > > > After this patch we should guarantee a forward progress for the OOM > > > killer even when the selected victim is sharing memory with a kernel > > > thread or global init. > > > > Coul

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-07-19 Thread Andrew Morton
On Tue, 19 Jul 2016 14:05:39 +0200 Michal Hocko wrote: > > After this patch we should guarantee a forward progress for the OOM > > killer even when the selected victim is sharing memory with a kernel > > thread or global init. > > Could you replace the last two paragraphs with the following. Tet

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-07-19 Thread Michal Hocko
Andrew, On Mon 20-06-16 14:43:48, Michal Hocko wrote: > From: Michal Hocko > > The only case where the oom_reaper is not triggered for the oom victim > is when it shares the memory with a kernel thread (aka use_mm) or with > the global init. After "mm, oom: skip vforked tasks from being selected

[PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-20 Thread Michal Hocko
From: Michal Hocko The only case where the oom_reaper is not triggered for the oom victim is when it shares the memory with a kernel thread (aka use_mm) or with the global init. After "mm, oom: skip vforked tasks from being selected" the victim cannot be a vforked task of the global init so we ar

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-16 Thread Tetsuo Handa
Tetsuo Handa wrote: > But this is not safe for CONFIG_MMU=y kernels as well. > can_oom_reap == false means that oom_reap_task() will not be called. > It is possible that the TIF_MEMDIE thread falls into > >atomic_read(&task->signal->oom_victims) > 0 && find_lock_task_mm(task) == > NULL > > s

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-16 Thread Tetsuo Handa
Michal Hocko wrote: > On Fri 10-06-16 00:15:18, Tetsuo Handa wrote: > [...] > > Nobody will set MMF_OOM_REAPED flag if can_oom_reap == true on > > CONFIG_MMU=n kernel. If a TIF_MEMDIE thread in CONFIG_MMU=n kernel > > is blocked before exit_oom_victim() in exit_mm() from do_exit() is > > called, th

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-15 Thread Michal Hocko
On Wed 15-06-16 16:37:01, Oleg Nesterov wrote: > Michal, > > I am going to ack the whole series, but send some nits/questions, > > On 06/09, Michal Hocko wrote: > > > > @@ -283,10 +283,22 @@ enum oom_scan_t oom_scan_process_thread(struct > > oom_control *oc, > > > > /* > > * This task

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-15 Thread Oleg Nesterov
Michal, I am going to ack the whole series, but send some nits/questions, On 06/09, Michal Hocko wrote: > > @@ -283,10 +283,22 @@ enum oom_scan_t oom_scan_process_thread(struct > oom_control *oc, > > /* >* This task already has access to memory reserves and is being killed. > -

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-09 Thread Michal Hocko
On Fri 10-06-16 00:15:18, Tetsuo Handa wrote: [...] > Nobody will set MMF_OOM_REAPED flag if can_oom_reap == true on > CONFIG_MMU=n kernel. If a TIF_MEMDIE thread in CONFIG_MMU=n kernel > is blocked before exit_oom_victim() in exit_mm() from do_exit() is > called, the system will lock up. This is n

Re: [PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-09 Thread Tetsuo Handa
Michal Hocko wrote: > The only case where the oom_reaper is not triggered for the oom victim > is when it shares the memory with a kernel thread (aka use_mm) or with > the global init. After "mm, oom: skip vforked tasks from being selected" > the victim cannot be a vforked task of the global init s

[PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-09 Thread Michal Hocko
From: Michal Hocko The only case where the oom_reaper is not triggered for the oom victim is when it shares the memory with a kernel thread (aka use_mm) or with the global init. After "mm, oom: skip vforked tasks from being selected" the victim cannot be a vforked task of the global init so we ar

Re: [RFC PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-06 Thread Michal Hocko
On Mon 06-06-16 15:26:50, Michal Hocko wrote: [...] > @@ -922,8 +941,17 @@ void oom_kill_process(struct oom_control *oc, struct > task_struct *p, > } > rcu_read_unlock(); > > - if (can_oom_reap) > + if (can_oom_reap) { > wake_oom_reaper(victim); > + } else i

Re: [RFC PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-06 Thread Michal Hocko
On Sat 04-06-16 00:16:32, Tetsuo Handa wrote: [...] > Leaving current thread from out_of_memory() without clearing TIF_MEMDIE might > cause OOM lockup, for there is no guarantee that current thread will not wait > for locks in unkillable state after current memory allocation request > completes >

Re: [RFC PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-06 Thread Michal Hocko
On Sat 04-06-16 00:16:32, Tetsuo Handa wrote: > Michal Hocko wrote: > > The only case where the oom_reaper is not triggered for the oom victim > > is when it shares the memory with a kernel thread (aka use_mm) or with > > the global init. After "mm, oom: skip vforked tasks from being selected" > >

Re: [RFC PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-03 Thread Tetsuo Handa
Michal Hocko wrote: > The only case where the oom_reaper is not triggered for the oom victim > is when it shares the memory with a kernel thread (aka use_mm) or with > the global init. After "mm, oom: skip vforked tasks from being selected" > the victim cannot be a vforked task of the global init s

[RFC PATCH 10/10] mm, oom: hide mm which is shared with kthread or global init

2016-06-03 Thread Michal Hocko
From: Michal Hocko The only case where the oom_reaper is not triggered for the oom victim is when it shares the memory with a kernel thread (aka use_mm) or with the global init. After "mm, oom: skip vforked tasks from being selected" the victim cannot be a vforked task of the global init so we ar