Skip to content

Commit f2a2a71

Browse files
Nick PigginLinus Torvalds
authored andcommitted
[PATCH] oom: less memdie
Don't cause all threads in all other thread groups to gain TIF_MEMDIE otherwise we'll get a thundering herd eating our memory reserve. This may not be the optimal scheme, but it fits our policy of allowing just one TIF_MEMDIE in the system at once. Signed-off-by: Nick Piggin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent f3af38d commit f2a2a71

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mm/oom_kill.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,12 @@ static int oom_kill_task(struct task_struct *p)
323323

324324
/*
325325
* kill all processes that share the ->mm (i.e. all threads),
326-
* but are in a different thread group.
326+
* but are in a different thread group. Don't let them have access
327+
* to memory reserves though, otherwise we might deplete all memory.
327328
*/
328329
do_each_thread(g, q) {
329330
if (q->mm == mm && q->tgid != p->tgid)
330-
__oom_kill_task(q, 1);
331+
force_sig(SIGKILL, p);
331332
} while_each_thread(g, q);
332333

333334
return 0;

0 commit comments

Comments
 (0)