Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209682
b: refs/heads/master
c: b52723c
h: refs/heads/master
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Aug 20, 2010
1 parent 43d7dfc commit f34d614
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: be71cf2202971e50ce4953d473649c724799eb8a
refs/heads/master: b52723c5607f7684c2c0c075f86f86da0d7fb6d0
9 changes: 6 additions & 3 deletions trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
unsigned long freed = 0;
unsigned int points;
enum oom_constraint constraint = CONSTRAINT_NONE;
int killed = 0;

blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
if (freed > 0)
Expand Down Expand Up @@ -683,15 +684,15 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
if (!oom_kill_process(current, gfp_mask, order, 0, totalpages,
NULL, nodemask,
"Out of memory (oom_kill_allocating_task)"))
return;
goto out;
}

retry:
p = select_bad_process(&points, totalpages, NULL,
constraint == CONSTRAINT_MEMORY_POLICY ? nodemask :
NULL);
if (PTR_ERR(p) == -1UL)
return;
goto out;

/* Found nothing?!?! Either we hang forever, or we panic. */
if (!p) {
Expand All @@ -703,13 +704,15 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
if (oom_kill_process(p, gfp_mask, order, points, totalpages, NULL,
nodemask, "Out of memory"))
goto retry;
killed = 1;
out:
read_unlock(&tasklist_lock);

/*
* Give "p" a good chance of killing itself before we
* retry to allocate memory unless "p" is current
*/
if (!test_thread_flag(TIF_MEMDIE))
if (killed && !test_thread_flag(TIF_MEMDIE))
schedule_timeout_uninterruptible(1);
}

Expand Down

0 comments on commit f34d614

Please sign in to comment.