aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 77a29cea5d76..0f692a2dbfcb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1469,8 +1469,8 @@ static u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
1469 return min(limit, memsw); 1469 return min(limit, memsw);
1470} 1470}
1471 1471
1472void __mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, 1472void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1473 int order) 1473 int order)
1474{ 1474{
1475 struct mem_cgroup *iter; 1475 struct mem_cgroup *iter;
1476 unsigned long chosen_points = 0; 1476 unsigned long chosen_points = 0;
@@ -1478,6 +1478,17 @@ void __mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
1478 unsigned int points = 0; 1478 unsigned int points = 0;
1479 struct task_struct *chosen = NULL; 1479 struct task_struct *chosen = NULL;
1480 1480
1481 /*
1482 * If current has a pending SIGKILL, then automatically select it. The
1483 * goal is to allow it to allocate so that it may quickly exit and free
1484 * its memory.
1485 */
1486 if (fatal_signal_pending(current)) {
1487 set_thread_flag(TIF_MEMDIE);
1488 return;
1489 }
1490
1491 check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL);
1481 totalpages = mem_cgroup_get_limit(memcg) >> PAGE_SHIFT ? : 1; 1492 totalpages = mem_cgroup_get_limit(memcg) >> PAGE_SHIFT ? : 1;
1482 for_each_mem_cgroup_tree(iter, memcg) { 1493 for_each_mem_cgroup_tree(iter, memcg) {
1483 struct cgroup *cgroup = iter->css.cgroup; 1494 struct cgroup *cgroup = iter->css.cgroup;