From: Michal Hocko <mhocko@suse.cz>
To: David Rientjes <rientjes@google.com>
Cc: Niv Yehezkel <executerx@gmail.com>,
linux-mm@kvack.org, akpm@linux-foundation.org,
hannes@cmpxchg.org, oleg@redhat.com
Subject: Re: [PATCH] oom: break after selecting process to kill
Date: Tue, 23 Sep 2014 20:30:20 +0200 [thread overview]
Message-ID: <20140923183020.GD29528@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.DEB.2.02.1409141345300.19382@chino.kir.corp.google.com>
On Sun 14-09-14 13:46:15, David Rientjes wrote:
> On Fri, 12 Sep 2014, Niv Yehezkel wrote:
>
> > > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> > > > index 1e11df8..3203578 100644
> > > > --- a/mm/oom_kill.c
> > > > +++ b/mm/oom_kill.c
> > > > @@ -315,7 +315,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
> > > > case OOM_SCAN_SELECT:
> > > > chosen = p;
> > > > chosen_points = ULONG_MAX;
> > > > - /* fall through */
> > > > + break;
> > > > case OOM_SCAN_CONTINUE:
> > > > continue;
> > > > case OOM_SCAN_ABORT:
> > > > @@ -324,6 +324,8 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
> > > > case OOM_SCAN_OK:
> > > > break;
> > > > };
> > > > + if (chosen_points == ULONG_MAX)
> > > > + break;
> > > > points = oom_badness(p, NULL, nodemask, totalpages);
> > > > if (!points || points < chosen_points)
> > > > continue;
> > > > --
> > > > 1.7.10.4
> > > >
> > >
> > >
> > > --
> > > Michal Hocko
> > > SUSE Labs
> >
> > As mentioned earlier, there's no need to keep iterating over all
> > running processes once the process with the highest score has been found.
> >
>
> This would lead to unnecessary oom killing since we may miss a process
> that returns OOM_SCAN_ABORT simply because it is later in the tasklist (we
> want to defer oom killing if there is an exiting process or an oom kill
> victim hasn't exited yet). NACK.
Good point David. I have completely missed this part!
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2014-09-23 18:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-11 21:33 [PATCH] oom: break after selecting process to kill Niv Yehezkel
2014-09-12 1:22 ` Zhang Zhen
2014-09-12 7:39 ` Niv Yehezkel
2014-09-12 8:08 ` Michal Hocko
2014-09-12 8:23 ` Niv Yehezkel
2014-09-12 12:18 ` Michal Hocko
2014-09-12 12:21 ` Niv Yehezkel
2014-09-12 12:31 ` Michal Hocko
2014-09-14 20:46 ` David Rientjes
2014-09-23 18:30 ` Michal Hocko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140923183020.GD29528@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=executerx@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).