]> Pileus Git - ~andy/linux/blobdiff - mm/oom_kill.c
Merge tag 'blackfin-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/realm...
[~andy/linux] / mm / oom_kill.c
index 054ff47c4478ddb6d6ef77cb66f6fd8330bdbea4..37b1b1903fb2c6aa84d9e25faf7e53381121e647 100644 (file)
@@ -327,10 +327,14 @@ static struct task_struct *select_bad_process(unsigned int *ppoints,
                        break;
                };
                points = oom_badness(p, NULL, nodemask, totalpages);
-               if (points > chosen_points) {
-                       chosen = p;
-                       chosen_points = points;
-               }
+               if (!points || points < chosen_points)
+                       continue;
+               /* Prefer thread group leaders for display purposes */
+               if (points == chosen_points && thread_group_leader(chosen))
+                       continue;
+
+               chosen = p;
+               chosen_points = points;
        }
        if (chosen)
                get_task_struct(chosen);