diff options
-rw-r--r-- | mm/oom_kill.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 7dcca55ede7c..b5a7b5f46e7a 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -292,11 +292,11 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, | |||
292 | unsigned long totalpages, struct mem_cgroup *mem, | 292 | unsigned long totalpages, struct mem_cgroup *mem, |
293 | const nodemask_t *nodemask) | 293 | const nodemask_t *nodemask) |
294 | { | 294 | { |
295 | struct task_struct *p; | 295 | struct task_struct *g, *p; |
296 | struct task_struct *chosen = NULL; | 296 | struct task_struct *chosen = NULL; |
297 | *ppoints = 0; | 297 | *ppoints = 0; |
298 | 298 | ||
299 | for_each_process(p) { | 299 | do_each_thread(g, p) { |
300 | unsigned int points; | 300 | unsigned int points; |
301 | 301 | ||
302 | if (oom_unkillable_task(p, mem, nodemask)) | 302 | if (oom_unkillable_task(p, mem, nodemask)) |
@@ -324,7 +324,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, | |||
324 | * the process of exiting and releasing its resources. | 324 | * the process of exiting and releasing its resources. |
325 | * Otherwise we could get an easy OOM deadlock. | 325 | * Otherwise we could get an easy OOM deadlock. |
326 | */ | 326 | */ |
327 | if (thread_group_empty(p) && (p->flags & PF_EXITING) && p->mm) { | 327 | if ((p->flags & PF_EXITING) && p->mm) { |
328 | if (p != current) | 328 | if (p != current) |
329 | return ERR_PTR(-1UL); | 329 | return ERR_PTR(-1UL); |
330 | 330 | ||
@@ -337,7 +337,7 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, | |||
337 | chosen = p; | 337 | chosen = p; |
338 | *ppoints = points; | 338 | *ppoints = points; |
339 | } | 339 | } |
340 | } | 340 | } while_each_thread(g, p); |
341 | 341 | ||
342 | return chosen; | 342 | return chosen; |
343 | } | 343 | } |