|
@@ -645,6 +645,16 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
|
|
/* Got some memory back in the last second. */
|
|
/* Got some memory back in the last second. */
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If current has a pending SIGKILL, 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)) {
|
|
|
|
+ set_thread_flag(TIF_MEMDIE);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (sysctl_panic_on_oom == 2) {
|
|
if (sysctl_panic_on_oom == 2) {
|
|
dump_header(NULL, gfp_mask, order, NULL);
|
|
dump_header(NULL, gfp_mask, order, NULL);
|
|
panic("out of memory. Compulsory panic_on_oom is selected.\n");
|
|
panic("out of memory. Compulsory panic_on_oom is selected.\n");
|