ASoC: davinci-mcasp: Set .symmetric_rates = 1 in snd_soc_dai_driver
[firefly-linux-kernel-4.4.55.git] / mm / oom_kill.c
index 77adc8e876aa22105fd3123e0a7f71937539d465..1ecc0bcaecc518458765347f8b0fa5d5eed46f75 100644 (file)
@@ -607,6 +607,9 @@ void check_panic_on_oom(struct oom_control *oc, enum oom_constraint constraint,
                if (constraint != CONSTRAINT_NONE)
                        return;
        }
+       /* Do not panic for oom kills triggered by sysrq */
+       if (oc->order == -1)
+               return;
        dump_header(oc, NULL, memcg);
        panic("Out of memory: %s panic_on_oom is enabled\n",
                sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide");
@@ -642,7 +645,6 @@ bool out_of_memory(struct oom_control *oc)
        unsigned long freed = 0;
        unsigned int uninitialized_var(points);
        enum oom_constraint constraint = CONSTRAINT_NONE;
-       int killed = 0;
 
        if (oom_killer_disabled)
                return false;
@@ -650,7 +652,7 @@ bool out_of_memory(struct oom_control *oc)
        blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
        if (freed > 0)
                /* Got some memory back in the last second. */
-               goto out;
+               return true;
 
        /*
         * If current has a pending SIGKILL or is exiting, then automatically
@@ -663,7 +665,7 @@ bool out_of_memory(struct oom_control *oc)
        if (current->mm &&
            (fatal_signal_pending(current) || task_will_free_mem(current))) {
                mark_oom_victim(current);
-               goto out;
+               return true;
        }
 
        /*
@@ -681,28 +683,24 @@ bool out_of_memory(struct oom_control *oc)
                get_task_struct(current);
                oom_kill_process(oc, current, 0, totalpages, NULL,
                                 "Out of memory (oom_kill_allocating_task)");
-               goto out;
+               return true;
        }
 
        p = select_bad_process(oc, &points, totalpages);
        /* Found nothing?!?! Either we hang forever, or we panic. */
-       if (!p) {
+       if (!p && oc->order != -1) {
                dump_header(oc, NULL, NULL);
                panic("Out of memory and no killable processes...\n");
        }
-       if (p != (void *)-1UL) {
+       if (p && p != (void *)-1UL) {
                oom_kill_process(oc, p, points, totalpages, NULL,
                                 "Out of memory");
-               killed = 1;
-       }
-out:
-       /*
-        * Give the killed threads a good chance of exiting before trying to
-        * allocate memory again.
-        */
-       if (killed)
+               /*
+                * Give the killed process a good chance to exit before trying
+                * to allocate memory again.
+                */
                schedule_timeout_killable(1);
-
+       }
        return true;
 }