|
|
@@ -1103,10 +1103,17 @@ bool out_of_memory(struct oom_control *oc)
|
|
|
}
|
|
|
|
|
|
select_bad_process(oc);
|
|
|
- /* Found nothing?!?! Either we hang forever, or we panic. */
|
|
|
- if (!oc->chosen && !is_sysrq_oom(oc) && !is_memcg_oom(oc)) {
|
|
|
+ /* Found nothing?!?! */
|
|
|
+ if (!oc->chosen) {
|
|
|
dump_header(oc, NULL);
|
|
|
- panic("Out of memory and no killable processes...\n");
|
|
|
+ pr_warn("Out of memory and no killable processes...\n");
|
|
|
+ /*
|
|
|
+ * If we got here due to an actual allocation at the
|
|
|
+ * system level, we cannot survive this and will enter
|
|
|
+ * an endless loop in the allocator. Bail out now.
|
|
|
+ */
|
|
|
+ if (!is_sysrq_oom(oc) && !is_memcg_oom(oc))
|
|
|
+ panic("System is deadlocked on memory\n");
|
|
|
}
|
|
|
if (oc->chosen && oc->chosen != (void *)-1UL)
|
|
|
oom_kill_process(oc, !is_memcg_oom(oc) ? "Out of memory" :
|