aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 2e3ce3a928b9..bc2627deb7f9 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -313,15 +313,24 @@ static int oom_kill_task(struct task_struct *p, const char *message)
313 if (mm == NULL) 313 if (mm == NULL)
314 return 1; 314 return 1;
315 315
316 /*
317 * Don't kill the process if any threads are set to OOM_DISABLE
318 */
319 do_each_thread(g, q) {
320 if (q->mm == mm && p->oomkilladj == OOM_DISABLE)
321 return 1;
322 } while_each_thread(g, q);
323
316 __oom_kill_task(p, message); 324 __oom_kill_task(p, message);
325
317 /* 326 /*
318 * kill all processes that share the ->mm (i.e. all threads), 327 * kill all processes that share the ->mm (i.e. all threads),
319 * but are in a different thread group 328 * but are in a different thread group
320 */ 329 */
321 do_each_thread(g, q) 330 do_each_thread(g, q) {
322 if (q->mm == mm && q->tgid != p->tgid) 331 if (q->mm == mm && q->tgid != p->tgid)
323 __oom_kill_task(q, message); 332 __oom_kill_task(q, message);
324 while_each_thread(g, q); 333 } while_each_thread(g, q);
325 334
326 return 0; 335 return 0;
327} 336}