]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Nov 2014 17:42:09 +0000 (09:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Nov 2014 17:42:09 +0000 (09:42 -0800)
added patches:
mm-invoke-oom-killer-from-remaining-unconverted-page-fault-handlers.patch

queue-3.10/mm-invoke-oom-killer-from-remaining-unconverted-page-fault-handlers.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/mm-invoke-oom-killer-from-remaining-unconverted-page-fault-handlers.patch b/queue-3.10/mm-invoke-oom-killer-from-remaining-unconverted-page-fault-handlers.patch
new file mode 100644 (file)
index 0000000..4f2153f
--- /dev/null
@@ -0,0 +1,144 @@
+From 609838cfed972d49a65aac7923a9ff5cbe482e30 Mon Sep 17 00:00:00 2001
+From: Johannes Weiner <hannes@cmpxchg.org>
+Date: Mon, 8 Jul 2013 15:59:50 -0700
+Subject: mm: invoke oom-killer from remaining unconverted page fault handlers
+
+From: Johannes Weiner <hannes@cmpxchg.org>
+
+commit 609838cfed972d49a65aac7923a9ff5cbe482e30 upstream.
+
+A few remaining architectures directly kill the page faulting task in an
+out of memory situation.  This is usually not a good idea since that
+task might not even use a significant amount of memory and so may not be
+the optimal victim to resolve the situation.
+
+Since 2.6.29's 1c0fe6e ("mm: invoke oom-killer from page fault") there
+is a hook that architecture page fault handlers are supposed to call to
+invoke the OOM killer and let it pick the right task to kill.  Convert
+the remaining architectures over to this hook.
+
+To have the previous behavior of simply taking out the faulting task the
+vm.oom_kill_allocating_task sysctl can be set to 1.
+
+Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
+Reviewed-by: Michal Hocko <mhocko@suse.cz>
+Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
+Acked-by: David Rientjes <rientjes@google.com>
+Acked-by: Vineet Gupta <vgupta@synopsys.com>   [arch/arc bits]
+Cc: James Hogan <james.hogan@imgtec.com>
+Cc: David Howells <dhowells@redhat.com>
+Cc: Jonas Bonn <jonas@southpole.se>
+Cc: Chen Liqin <liqin.chen@sunplusct.com>
+Cc: Lennox Wu <lennox.wu@gmail.com>
+Cc: Chris Metcalf <cmetcalf@tilera.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arc/mm/fault.c      |    6 ++++--
+ arch/metag/mm/fault.c    |    6 ++++--
+ arch/mn10300/mm/fault.c  |    7 ++++---
+ arch/openrisc/mm/fault.c |    8 ++++----
+ arch/score/mm/fault.c    |    8 ++++----
+ arch/tile/mm/fault.c     |    8 ++++----
+ 6 files changed, 24 insertions(+), 19 deletions(-)
+
+--- a/arch/arc/mm/fault.c
++++ b/arch/arc/mm/fault.c
+@@ -206,8 +206,10 @@ out_of_memory:
+       }
+       up_read(&mm->mmap_sem);
+-      if (user_mode(regs))
+-              do_group_exit(SIGKILL); /* This will never return */
++      if (user_mode(regs)) {
++              pagefault_out_of_memory();
++              return;
++      }
+       goto no_context;
+--- a/arch/metag/mm/fault.c
++++ b/arch/metag/mm/fault.c
+@@ -224,8 +224,10 @@ do_sigbus:
+        */
+ out_of_memory:
+       up_read(&mm->mmap_sem);
+-      if (user_mode(regs))
+-              do_group_exit(SIGKILL);
++      if (user_mode(regs)) {
++              pagefault_out_of_memory();
++              return 1;
++      }
+ no_context:
+       /* Are we prepared to handle this kernel fault?  */
+--- a/arch/mn10300/mm/fault.c
++++ b/arch/mn10300/mm/fault.c
+@@ -345,9 +345,10 @@ no_context:
+  */
+ out_of_memory:
+       up_read(&mm->mmap_sem);
+-      printk(KERN_ALERT "VM: killing process %s\n", tsk->comm);
+-      if ((fault_code & MMUFCR_xFC_ACCESS) == MMUFCR_xFC_ACCESS_USR)
+-              do_exit(SIGKILL);
++      if ((fault_code & MMUFCR_xFC_ACCESS) == MMUFCR_xFC_ACCESS_USR) {
++              pagefault_out_of_memory();
++              return;
++      }
+       goto no_context;
+ do_sigbus:
+--- a/arch/openrisc/mm/fault.c
++++ b/arch/openrisc/mm/fault.c
+@@ -267,10 +267,10 @@ out_of_memory:
+       __asm__ __volatile__("l.nop 1");
+       up_read(&mm->mmap_sem);
+-      printk("VM: killing process %s\n", tsk->comm);
+-      if (user_mode(regs))
+-              do_exit(SIGKILL);
+-      goto no_context;
++      if (!user_mode(regs))
++              goto no_context;
++      pagefault_out_of_memory();
++      return;
+ do_sigbus:
+       up_read(&mm->mmap_sem);
+--- a/arch/score/mm/fault.c
++++ b/arch/score/mm/fault.c
+@@ -172,10 +172,10 @@ out_of_memory:
+               down_read(&mm->mmap_sem);
+               goto survive;
+       }
+-      printk("VM: killing process %s\n", tsk->comm);
+-      if (user_mode(regs))
+-              do_group_exit(SIGKILL);
+-      goto no_context;
++      if (!user_mode(regs))
++              goto no_context;
++      pagefault_out_of_memory();
++      return;
+ do_sigbus:
+       up_read(&mm->mmap_sem);
+--- a/arch/tile/mm/fault.c
++++ b/arch/tile/mm/fault.c
+@@ -573,10 +573,10 @@ out_of_memory:
+               down_read(&mm->mmap_sem);
+               goto survive;
+       }
+-      pr_alert("VM: killing process %s\n", tsk->comm);
+-      if (!is_kernel_mode)
+-              do_group_exit(SIGKILL);
+-      goto no_context;
++      if (is_kernel_mode)
++              goto no_context;
++      pagefault_out_of_memory();
++      return 0;
+ do_sigbus:
+       up_read(&mm->mmap_sem);
index 822aa6abb5d600b8e516e1ce8d702ee0524d844c..83fea6dea13d9596e239519a8e70a2f1d3878529 100644 (file)
@@ -59,3 +59,4 @@ kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch
 net-sctp-fix-remote-memory-pressure-from-excessive-queueing.patch
 net-sctp-fix-panic-on-duplicate-asconf-chunks.patch
 net-sctp-fix-skb_over_panic-when-receiving-malformed-asconf-chunks.patch
+mm-invoke-oom-killer-from-remaining-unconverted-page-fault-handlers.patch