diff options
Diffstat (limited to 'mm/memcontrol.c')
| -rw-r--r-- | mm/memcontrol.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b843aeeb3..f58bcb213 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1807,16 +1807,14 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, unsigned int points = 0; struct task_struct *chosen = NULL; - mutex_lock(&oom_lock); - /* * If current has a pending SIGKILL or is exiting, then automatically * select it. The goal is to allow it to allocate so that it may * quickly exit and free its memory. */ if (fatal_signal_pending(current) || task_will_free_mem(current)) { - mark_oom_victim(current); - goto unlock; + mark_tsk_oom_victim(current); + return; } check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL); @@ -1844,7 +1842,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, mem_cgroup_iter_break(memcg, iter); if (chosen) put_task_struct(chosen); - goto unlock; + return; case OOM_SCAN_OK: break; }; @@ -1865,13 +1863,11 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, cgroup_iter_end(cgroup, &it); } - if (chosen) { - points = chosen_points * 1000 / totalpages; - oom_kill_process(chosen, gfp_mask, order, points, totalpages, - memcg, NULL, "Memory cgroup out of memory"); - } -unlock: - mutex_unlock(&oom_lock); + if (!chosen) + return; + points = chosen_points * 1000 / totalpages; + oom_kill_process(chosen, gfp_mask, order, points, totalpages, memcg, + NULL, "Memory cgroup out of memory"); } static unsigned long mem_cgroup_reclaim(struct mem_cgroup *memcg, @@ -2266,7 +2262,7 @@ bool mem_cgroup_oom_synchronize(bool handle) if (!memcg) return false; - if (!handle || oom_killer_disabled) + if (!handle) goto cleanup; owait.memcg = memcg; |
