[Devel] [PATCH rh7 1/5] oom: do not select child that has already been killed

Vladimir Davydov vdavydov at virtuozzo.com
Tue Apr 19 07:59:02 PDT 2016


On Tue, Apr 19, 2016 at 05:39:28PM +0300, Kirill Tkhai wrote:
> 
> 
> On 12.04.2016 19:34, Vladimir Davydov wrote:
> > Otherwise, we might end up selecting the same process over and over
> > again in case it got stuck somewhere in exit path for some reason.
> > 
> > Signed-off-by: Vladimir Davydov <vdavydov at virtuozzo.com>
> > ---
> >  mm/oom_kill.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> > index 2402fcceda6e..b21641ff508e 100644
> > --- a/mm/oom_kill.c
> > +++ b/mm/oom_kill.c
> > @@ -847,6 +847,9 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
> >  
> >  			if (child->mm == p->mm)
> >  				continue;
> > +			if (!child->mm ||
> 
> This check works only if p is kthreadadd_task, and it seems it's never valid. It's not a problem,
> just a note.

The task could have exited already and cleared its mm. Obviously, we
don't want to select such tasks.


More information about the Devel mailing list