diff options
-rw-r--r-- | mm/oom_kill.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 372692294844..ea2147dabba6 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -373,11 +373,6 @@ static void __oom_kill_task(struct task_struct *p, int verbose) | |||
373 | 373 | ||
374 | static int oom_kill_task(struct task_struct *p) | 374 | static int oom_kill_task(struct task_struct *p) |
375 | { | 375 | { |
376 | struct mm_struct *mm; | ||
377 | struct task_struct *g, *q; | ||
378 | |||
379 | mm = p->mm; | ||
380 | |||
381 | /* WARNING: mm may not be dereferenced since we did not obtain its | 376 | /* WARNING: mm may not be dereferenced since we did not obtain its |
382 | * value from get_task_mm(p). This is OK since all we need to do is | 377 | * value from get_task_mm(p). This is OK since all we need to do is |
383 | * compare mm to q->mm below. | 378 | * compare mm to q->mm below. |
@@ -386,21 +381,11 @@ static int oom_kill_task(struct task_struct *p) | |||
386 | * change to NULL at any time since we do not hold task_lock(p). | 381 | * change to NULL at any time since we do not hold task_lock(p). |
387 | * However, this is of no concern to us. | 382 | * However, this is of no concern to us. |
388 | */ | 383 | */ |
389 | if (!mm || p->signal->oom_adj == OOM_DISABLE) | 384 | if (!p->mm || p->signal->oom_adj == OOM_DISABLE) |
390 | return 1; | 385 | return 1; |
391 | 386 | ||
392 | __oom_kill_task(p, 1); | 387 | __oom_kill_task(p, 1); |
393 | 388 | ||
394 | /* | ||
395 | * kill all processes that share the ->mm (i.e. all threads), | ||
396 | * but are in a different thread group. Don't let them have access | ||
397 | * to memory reserves though, otherwise we might deplete all memory. | ||
398 | */ | ||
399 | do_each_thread(g, q) { | ||
400 | if (q->mm == mm && !same_thread_group(q, p)) | ||
401 | force_sig(SIGKILL, q); | ||
402 | } while_each_thread(g, q); | ||
403 | |||
404 | return 0; | 389 | return 0; |
405 | } | 390 | } |
406 | 391 | ||