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. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>