[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201602050008.HEG12919.FFOMOHVtQFSLJO@I-love.SAKURA.ne.jp>
Date: Fri, 5 Feb 2016 00:08:25 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: mhocko@...nel.org
Cc: akpm@...ux-foundation.org, rientjes@...gle.com, mgorman@...e.de,
oleg@...hat.com, torvalds@...ux-foundation.org, hughd@...gle.com,
andrea@...nel.org, riel@...hat.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/5] oom: clear TIF_MEMDIE after oom_reaper managed to unmap the address space
Michal Hocko wrote:
> > > + /*
> > > + * Clear TIF_MEMDIE because the task shouldn't be sitting on a
> > > + * reasonably reclaimable memory anymore. OOM killer can continue
> > > + * by selecting other victim if unmapping hasn't led to any
> > > + * improvements. This also means that selecting this task doesn't
> > > + * make any sense.
> > > + */
> > > + tsk->signal->oom_score_adj = OOM_SCORE_ADJ_MIN;
> > > + exit_oom_victim(tsk);
> >
> > I noticed that updating only one thread group's oom_score_adj disables
> > further wake_oom_reaper() calls due to rough-grained can_oom_reap check at
> >
> > p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN
> >
> > in oom_kill_process(). I think we need to either update all thread groups'
> > oom_score_adj using the reaped mm equally or use more fine-grained can_oom_reap
> > check which ignores OOM_SCORE_ADJ_MIN if all threads in that thread group are
> > dying or exiting.
>
> I do not understand. Why would you want to reap the mm again when
> this has been done already? The mm is shared, right?
The mm is shared between previous victim and next victim, but these victims
are in different thread groups. The OOM killer selects next victim whose mm
was already reaped due to sharing previous victim's memory. We don't want
the OOM killer to select such next victim. Maybe set MMF_OOM_REAP_DONE on
the previous victim's mm and check it instead of TIF_MEMDIE when selecting
a victim? That will also avoid problems caused by clearing TIF_MEMDIE?
Powered by blists - more mailing lists