Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42646
b: refs/heads/master
c: c33e0fc
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Dec 7, 2006
1 parent e4b0777 commit 42677ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7253f4ef04b1cd138baf2b29a95473743ac0a307
refs/heads/master: c33e0fca3508f0aa387b1c10d0ef158102deb140
13 changes: 11 additions & 2 deletions trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,24 @@ static int oom_kill_task(struct task_struct *p, const char *message)
if (mm == NULL)
return 1;

/*
* Don't kill the process if any threads are set to OOM_DISABLE
*/
do_each_thread(g, q) {
if (q->mm == mm && p->oomkilladj == OOM_DISABLE)
return 1;
} while_each_thread(g, q);

__oom_kill_task(p, message);

/*
* kill all processes that share the ->mm (i.e. all threads),
* but are in a different thread group
*/
do_each_thread(g, q)
do_each_thread(g, q) {
if (q->mm == mm && q->tgid != p->tgid)
__oom_kill_task(q, message);
while_each_thread(g, q);
} while_each_thread(g, q);

return 0;
}
Expand Down

0 comments on commit 42677ca

Please sign in to comment.