mm: oom_kill: simplify OOM killer locking
[deliverable/linux.git] / drivers / tty / sysrq.c
index 843f2cdc280b9d178d09469eb0363658d6a69805..b20d2c0ec45182ae176a9d9f04c6063c244715ec 100644 (file)
@@ -356,9 +356,11 @@ static struct sysrq_key_op sysrq_term_op = {
 
 static void moom_callback(struct work_struct *ignored)
 {
+       mutex_lock(&oom_lock);
        if (!out_of_memory(node_zonelist(first_memory_node, GFP_KERNEL),
                           GFP_KERNEL, 0, NULL, true))
                pr_info("OOM request ignored because killer is disabled\n");
+       mutex_unlock(&oom_lock);
 }
 
 static DECLARE_WORK(moom_work, moom_callback);
This page took 0.023753 seconds and 5 git commands to generate.