All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 00/14] convert remaining architectures to pagefault_out_of_memory()
@ 2010-04-22 16:06 npiggin
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
                   ` (15 more replies)
  0 siblings, 16 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton

Hi,

The following patches convert the rest of the architectures to use
pagefault_on_out_of_memory. The reason is to provide a consistent
architecture independent page fault hook that the kernel can use.
Also see commit 1c0fe6e3bd

x86, arm, mips, sparc, s390, uml are already using this.

Subsequent patches will be sent to arch maintainers and cc'ed to
linux-arch.

Thanks,
Nick

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 01/14] alpha: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:46   ` David Rientjes
                     ` (2 more replies)
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
                   ` (14 subsequent siblings)
  15 siblings, 3 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-alpha, Richard Henderson

[-- Attachment #1: alpha-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 1104 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-alpha@vger.kernel.org
Cc: Richard Henderson <rth@twiddle.net>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/alpha/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/alpha/mm/fault.c
+++ linux-2.6/arch/alpha/mm/fault.c
@@ -188,16 +188,10 @@ do_page_fault(unsigned long address, uns
 	/* We ran out of memory, or some other thing happened to us that
 	   made us unable to handle the page fault gracefully.  */
  out_of_memory:
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk(KERN_ALERT "VM: killing process %s(%d)\n",
-	       current->comm, task_pid_nr(current));
 	if (!user_mode(regs))
 		goto no_context;
-	do_group_exit(SIGKILL);
+	pagefault_out_of_memory();
+	return;
 
  do_sigbus:
 	/* Send a sigbus, regardless of whether we were in kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 02/14] avr32: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:45   ` David Rientjes
  2010-04-22 16:06 ` [patch 03/14] cris: " npiggin
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, Haavard Skinnemoen

[-- Attachment #1: avr32-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 911 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/avr32/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/avr32/mm/fault.c
+++ linux-2.6/arch/avr32/mm/fault.c
@@ -211,15 +211,10 @@ no_context:
 	 */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		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;
+	pagefault_out_of_memory();
+	if (!user_mode(regs))
+		goto no_context;
+	return;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 03/14] cris: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:50   ` David Rientjes
  2010-04-23  4:33   ` Mikael Starvik
  2010-04-22 16:06 ` [patch 04/14] frv: " npiggin
                   ` (12 subsequent siblings)
  15 siblings, 2 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch
  Cc: David Rientjes, Andrew Morton, linux-cris-kernel, Mikael Starvik

[-- Attachment #1: cris-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 856 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-cris-kernel@axis.com
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/cris/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/cris/mm/fault.c
+++ linux-2.6/arch/cris/mm/fault.c
@@ -245,10 +245,10 @@ do_page_fault(unsigned long address, str
 
  out_of_memory:
 	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);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 04/14] frv: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (2 preceding siblings ...)
  2010-04-22 16:06 ` [patch 03/14] cris: " npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:50   ` David Rientjes
  2010-04-22 16:06   ` npiggin
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, David Howells

[-- Attachment #1: frv-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 843 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: David Howells <dhowells@redhat.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/frv/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/frv/mm/fault.c
+++ linux-2.6/arch/frv/mm/fault.c
@@ -257,10 +257,10 @@ asmlinkage void do_page_fault(int datamm
  */
  out_of_memory:
 	up_read(&mm->mmap_sem);
-	printk("VM: killing process %s\n", current->comm);
-	if (user_mode(__frame))
-		do_group_exit(SIGKILL);
-	goto no_context;
+	if (!user_mode(__frame))
+		goto no_context;
+	pagefault_out_of_memory();
+	return;
 
  do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 05/14] ia64: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
@ 2010-04-22 16:06   ` npiggin
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-ia64, Tony Luck

[-- Attachment #1: ia64-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 921 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-ia64@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/ia64/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/ia64/mm/fault.c
+++ linux-2.6/arch/ia64/mm/fault.c
@@ -276,13 +276,7 @@ ia64_do_page_fault (unsigned long addres
 
   out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	goto no_context;
+	if (!user_mode(regs))
+		goto no_context;
+	pagefault_out_of_memory();
 }

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 05/14] ia64: invoke oom-killer from page fault
@ 2010-04-22 16:06   ` npiggin
  0 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-ia64, Tony Luck

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-ia64@vger.kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/ia64/mm/fault.c
=================================--- linux-2.6.orig/arch/ia64/mm/fault.c
+++ linux-2.6/arch/ia64/mm/fault.c
@@ -276,13 +276,7 @@ ia64_do_page_fault (unsigned long addres
 
   out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	goto no_context;
+	if (!user_mode(regs))
+		goto no_context;
+	pagefault_out_of_memory();
 }



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 06/14] m32r: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (4 preceding siblings ...)
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:52   ` David Rientjes
  2010-04-22 16:06 ` [patch 07/14] m68k: " npiggin
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-m32r, Hirokazu Takata

[-- Attachment #1: m32r-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 919 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-m32r@ml.linux-m32r.org
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/m32r/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/m32r/mm/fault.c
+++ linux-2.6/arch/m32r/mm/fault.c
@@ -271,15 +271,10 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(tsk)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk("VM: killing process %s\n", tsk->comm);
 	if (error_code & ACE_USERMODE)
-		do_group_exit(SIGKILL);
-	goto no_context;
+		goto no_context;
+	pagefault_out_of_memory();
+	return;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 07/14] m68k: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (5 preceding siblings ...)
  2010-04-22 16:06 ` [patch 06/14] m32r: " npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:53   ` David Rientjes
  2010-04-23  7:21   ` Geert Uytterhoeven
  2010-04-22 16:06 ` [patch 08/14] microblaze: " npiggin
                   ` (8 subsequent siblings)
  15 siblings, 2 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-m68k, Geert Uytterhoeven

[-- Attachment #1: m68k-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 937 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-m68k@lists.linux-m68k.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/m68k/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/m68k/mm/fault.c
+++ linux-2.6/arch/m68k/mm/fault.c
@@ -180,15 +180,10 @@ good_area:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-
-	printk("VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
+	if (!user_mode(regs))
+		goto no_context;
+	pagefault_out_of_memory();
+	return;
 
 no_context:
 	current->thread.signo = SIGBUS;

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 08/14] microblaze: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (6 preceding siblings ...)
  2010-04-22 16:06 ` [patch 07/14] m68k: " npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:54   ` David Rientjes
  2010-04-22 16:06 ` [patch 09/14] mn10300: " npiggin
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch
  Cc: David Rientjes, Andrew Morton, microblaze-uclinux, Michal Simek

[-- Attachment #1: microblaze-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 1046 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/microblaze/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/microblaze/mm/fault.c
+++ linux-2.6/arch/microblaze/mm/fault.c
@@ -273,16 +273,11 @@ bad_area_nosemaphore:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	if (current->pid == 1) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
 	up_read(&mm->mmap_sem);
-	printk(KERN_WARNING "VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_exit(SIGKILL);
-	bad_page_fault(regs, address, SIGKILL);
+	if (!user_mode(regs))
+		bad_page_fault(regs, address, SIGKILL);
+	else
+		pagefault_out_of_memory();
 	return;
 
 do_sigbus:

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 09/14] mn10300: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (7 preceding siblings ...)
  2010-04-22 16:06 ` [patch 08/14] microblaze: " npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 16:06   ` npiggin
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-am33-list, David Howells

[-- Attachment #1: mn10300-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 957 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-am33-list@redhat.com
Cc: David Howells <dhowells@redhat.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/mn10300/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/mn10300/mm/fault.c
+++ linux-2.6/arch/mn10300/mm/fault.c
@@ -338,11 +338,10 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	monitor_signal(regs);
-	printk(KERN_ALERT "VM: killing process %s\n", tsk->comm);
-	if ((fault_code & MMUFCR_xFC_ACCESS) == MMUFCR_xFC_ACCESS_USR)
-		do_exit(SIGKILL);
-	goto no_context;
+	if ((fault_code & MMUFCR_xFC_ACCESS) != MMUFCR_xFC_ACCESS_USR)
+		goto no_context;
+	pagefault_out_of_memory();
+	return;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 10/14] parisc: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
@ 2010-04-22 16:06   ` npiggin
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-parisc, Kyle McMartin

[-- Attachment #1: parisc-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 807 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-parisc@vger.kernel.org
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/parisc/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/parisc/mm/fault.c
+++ linux-2.6/arch/parisc/mm/fault.c
@@ -264,8 +264,7 @@ no_context:
 
   out_of_memory:
 	up_read(&mm->mmap_sem);
-	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	goto no_context;
+	if (!user_mode(regs))
+		goto no_context;
+	pagefault_out_of_memory();
 }



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 10/14] parisc: invoke oom-killer from page fault
@ 2010-04-22 16:06   ` npiggin
  0 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-parisc, Kyle McMartin

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-parisc@vger.kernel.org
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/parisc/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/parisc/mm/fault.c
+++ linux-2.6/arch/parisc/mm/fault.c
@@ -264,8 +264,7 @@ no_context:
 
   out_of_memory:
 	up_read(&mm->mmap_sem);
-	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	goto no_context;
+	if (!user_mode(regs))
+		goto no_context;
+	pagefault_out_of_memory();
 }



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 11/14] powerpc: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
@ 2010-04-22 16:06   ` npiggin
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch
  Cc: David Rientjes, Andrew Morton, linuxppc-dev, Benjamin Herrenschmidt

[-- Attachment #1: powerpc-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 965 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linuxppc-dev@ozlabs.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/powerpc/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/powerpc/mm/fault.c
+++ linux-2.6/arch/powerpc/mm/fault.c
@@ -359,15 +359,10 @@ bad_area_nosemaphore:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk("VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	return SIGKILL;
+	if (!user_mode(regs))
+		return SIGKILL;
+	pagefault_out_of_memory();
+	return 0;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 11/14] powerpc: invoke oom-killer from page fault
@ 2010-04-22 16:06   ` npiggin
  0 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: linuxppc-dev, Andrew Morton, David Rientjes

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linuxppc-dev@ozlabs.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/powerpc/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/powerpc/mm/fault.c
+++ linux-2.6/arch/powerpc/mm/fault.c
@@ -359,15 +359,10 @@ bad_area_nosemaphore:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk("VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	return SIGKILL;
+	if (!user_mode(regs))
+		return SIGKILL;
+	pagefault_out_of_memory();
+	return 0;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 12/14] score: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (10 preceding siblings ...)
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:57   ` David Rientjes
  2010-04-28  7:30   ` liqin.chen
  2010-04-22 16:06   ` npiggin
                   ` (3 subsequent siblings)
  15 siblings, 2 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, Chen Liqin, Lennox Wu

[-- Attachment #1: score-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 937 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: Chen Liqin <liqin.chen@sunplusct.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/score/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/score/mm/fault.c
+++ linux-2.6/arch/score/mm/fault.c
@@ -167,15 +167,10 @@ no_context:
 	*/
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(tsk)) {
-		yield();
-		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);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 13/14] sh: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
@ 2010-04-22 16:06   ` npiggin
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-sh, Paul Mundt

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-sh@vger.kernel.org
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/sh/mm/fault_32.c
=================================--- linux-2.6.orig/arch/sh/mm/fault_32.c
+++ linux-2.6/arch/sh/mm/fault_32.c
@@ -290,15 +290,10 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		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);
Index: linux-2.6/arch/sh/mm/tlbflush_64.c
=================================--- linux-2.6.orig/arch/sh/mm/tlbflush_64.c
+++ linux-2.6/arch/sh/mm/tlbflush_64.c
@@ -294,22 +294,11 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	if (is_global_init(current)) {
-		panic("INIT out of memory\n");
-		yield();
-		goto survive;
-	}
-	printk("fault:Out of memory\n");
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		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:
 	printk("fault:Do sigbus\n");



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 13/14] sh: invoke oom-killer from page fault
@ 2010-04-22 16:06   ` npiggin
  0 siblings, 0 replies; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, linux-sh, Paul Mundt

[-- Attachment #1: sh-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 1732 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-sh@vger.kernel.org
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/sh/mm/fault_32.c
===================================================================
--- linux-2.6.orig/arch/sh/mm/fault_32.c
+++ linux-2.6/arch/sh/mm/fault_32.c
@@ -290,15 +290,10 @@ no_context:
  */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		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);
Index: linux-2.6/arch/sh/mm/tlbflush_64.c
===================================================================
--- linux-2.6.orig/arch/sh/mm/tlbflush_64.c
+++ linux-2.6/arch/sh/mm/tlbflush_64.c
@@ -294,22 +294,11 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-	if (is_global_init(current)) {
-		panic("INIT out of memory\n");
-		yield();
-		goto survive;
-	}
-	printk("fault:Out of memory\n");
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		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:
 	printk("fault:Do sigbus\n");



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [patch 14/14] xtensa: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (12 preceding siblings ...)
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 16:06 ` npiggin
  2010-04-22 20:58   ` David Rientjes
  2010-04-23 16:46 ` [patch 04/14] frv: " David Howells
  2010-04-23 16:46 ` [patch 09/14] mn10300: " David Howells
  15 siblings, 1 reply; 50+ messages in thread
From: npiggin @ 2010-04-22 16:06 UTC (permalink / raw)
  To: linux-arch; +Cc: David Rientjes, Andrew Morton, Chris Zankel

[-- Attachment #1: xtensa-pagefault-use-oom.patch --]
[-- Type: text/plain, Size: 933 bytes --]

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: Chris Zankel <chris@zankel.net>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/xtensa/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/xtensa/mm/fault.c
+++ linux-2.6/arch/xtensa/mm/fault.c
@@ -146,15 +146,10 @@ bad_area:
 	 */
 out_of_memory:
 	up_read(&mm->mmap_sem);
-	if (is_global_init(current)) {
-		yield();
-		down_read(&mm->mmap_sem);
-		goto survive;
-	}
-	printk("VM: killing process %s\n", current->comm);
-	if (user_mode(regs))
-		do_group_exit(SIGKILL);
-	bad_page_fault(regs, address, SIGKILL);
+	if (!user_mode(regs))
+		bad_page_fault(regs, address, SIGKILL);
+	else
+		pagefault_out_of_memory();
 	return;
 
 do_sigbus:

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 02/14] avr32: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
@ 2010-04-22 20:45   ` David Rientjes
  2010-04-23 10:23     ` Nick Piggin
  0 siblings, 1 reply; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:45 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, Haavard Skinnemoen

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/avr32/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/avr32/mm/fault.c
> +++ linux-2.6/arch/avr32/mm/fault.c
> @@ -211,15 +211,10 @@ no_context:
>  	 */
>  out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(current)) {
> -		yield();
> -		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;
> +	pagefault_out_of_memory();
> +	if (!user_mode(regs))
> +		goto no_context;

We want to test for !user_mode(regs) before calling 
pagefault_out_of_memory().

> +	return;
>  
>  do_sigbus:
>  	up_read(&mm->mmap_sem);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 01/14] alpha: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
@ 2010-04-22 20:46   ` David Rientjes
  2010-04-26 20:32   ` David Rientjes
  2010-04-28  2:58   ` Matt Turner
  2 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:46 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-alpha, Richard Henderson

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-alpha@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 03/14] cris: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 03/14] cris: " npiggin
@ 2010-04-22 20:50   ` David Rientjes
  2010-04-23  4:33   ` Mikael Starvik
  1 sibling, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:50 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-cris-kernel, Mikael Starvik

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-cris-kernel@axis.com
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 04/14] frv: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 04/14] frv: " npiggin
@ 2010-04-22 20:50   ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:50 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, David Howells

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 05/14] ia64: invoke oom-killer from page fault
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 20:51     ` David Rientjes
  -1 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:51 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-ia64, Tony Luck

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-ia64@vger.kernel.org
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

> ---
> Index: linux-2.6/arch/ia64/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/ia64/mm/fault.c
> +++ linux-2.6/arch/ia64/mm/fault.c
> @@ -276,13 +276,7 @@ ia64_do_page_fault (unsigned long addres
>  
>    out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(current)) {
> -		yield();
> -		down_read(&mm->mmap_sem);
> -		goto survive;
> -	}
> -	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
> -	if (user_mode(regs))
> -		do_group_exit(SIGKILL);
> -	goto no_context;
> +	if (!user_mode(regs))
> +		goto no_context;
> +	pagefault_out_of_memory();
>  }
> 
> 
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 05/14] ia64: invoke oom-killer from page fault
@ 2010-04-22 20:51     ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:51 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-ia64, Tony Luck

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-ia64@vger.kernel.org
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

> ---
> Index: linux-2.6/arch/ia64/mm/fault.c
> =================================> --- linux-2.6.orig/arch/ia64/mm/fault.c
> +++ linux-2.6/arch/ia64/mm/fault.c
> @@ -276,13 +276,7 @@ ia64_do_page_fault (unsigned long addres
>  
>    out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(current)) {
> -		yield();
> -		down_read(&mm->mmap_sem);
> -		goto survive;
> -	}
> -	printk(KERN_CRIT "VM: killing process %s\n", current->comm);
> -	if (user_mode(regs))
> -		do_group_exit(SIGKILL);
> -	goto no_context;
> +	if (!user_mode(regs))
> +		goto no_context;
> +	pagefault_out_of_memory();
>  }
> 
> 
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 06/14] m32r: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 06/14] m32r: " npiggin
@ 2010-04-22 20:52   ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:52 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-m32r, Hirokazu Takata

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-m32r@ml.linux-m32r.org
> Cc: Hirokazu Takata <takata@linux-m32r.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/m32r/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/m32r/mm/fault.c
> +++ linux-2.6/arch/m32r/mm/fault.c
> @@ -271,15 +271,10 @@ no_context:
>   */
>  out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(tsk)) {
> -		yield();
> -		down_read(&mm->mmap_sem);
> -		goto survive;
> -	}
> -	printk("VM: killing process %s\n", tsk->comm);
>  	if (error_code & ACE_USERMODE)

This should be !(error_code & ACE_USERMODE) instead.

> -		do_group_exit(SIGKILL);
> -	goto no_context;
> +		goto no_context;
> +	pagefault_out_of_memory();
> +	return;
>  
>  do_sigbus:
>  	up_read(&mm->mmap_sem);
> 
> 
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 07/14] m68k: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 07/14] m68k: " npiggin
@ 2010-04-22 20:53   ` David Rientjes
  2010-04-23  7:21   ` Geert Uytterhoeven
  1 sibling, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:53 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-m68k, Geert Uytterhoeven

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 08/14] microblaze: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 08/14] microblaze: " npiggin
@ 2010-04-22 20:54   ` David Rientjes
  2010-04-23  6:30     ` Michal Simek
  0 siblings, 1 reply; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:54 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, microblaze-uclinux, Michal Simek

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: microblaze-uclinux@itee.uq.edu.au
> Cc: Michal Simek <monstr@monstr.eu>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 10/14] parisc: invoke oom-killer from page fault
  2010-04-22 16:06   ` npiggin
  (?)
@ 2010-04-22 20:56   ` David Rientjes
  2010-04-26 15:00     ` Kyle McMartin
  -1 siblings, 1 reply; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:56 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-parisc, Kyle McMartin

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-parisc@vger.kernel.org
> Cc: Kyle McMartin <kyle@mcmartin.ca>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 12/14] score: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 12/14] score: " npiggin
@ 2010-04-22 20:57   ` David Rientjes
  2010-04-28  7:30   ` liqin.chen
  1 sibling, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:57 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, Chen Liqin, Lennox Wu

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: Chen Liqin <liqin.chen@sunplusct.com>
> Cc: Lennox Wu <lennox.wu@gmail.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 13/14] sh: invoke oom-killer from page fault
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 20:58     ` David Rientjes
  -1 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:58 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-sh, Paul Mundt

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-sh@vger.kernel.org
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 13/14] sh: invoke oom-killer from page fault
@ 2010-04-22 20:58     ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:58 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-sh, Paul Mundt

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-sh@vger.kernel.org
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 14/14] xtensa: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 14/14] xtensa: " npiggin
@ 2010-04-22 20:58   ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 20:58 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, Chris Zankel

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: Chris Zankel <chris@zankel.net>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 11/14] powerpc: invoke oom-killer from page fault
  2010-04-22 16:06   ` npiggin
@ 2010-04-22 21:44     ` David Rientjes
  -1 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 21:44 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linuxppc-dev, Benjamin Herrenschmidt

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linuxppc-dev@ozlabs.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/powerpc/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/mm/fault.c
> +++ linux-2.6/arch/powerpc/mm/fault.c
> @@ -359,15 +359,10 @@ bad_area_nosemaphore:
>   */
>  out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(current)) {
> -		yield();
> -		down_read(&mm->mmap_sem);
> -		goto survive;
> -	}
> -	printk("VM: killing process %s\n", current->comm);
> -	if (user_mode(regs))
> -		do_group_exit(SIGKILL);
> -	return SIGKILL;
> +	if (!user_mode(regs))
> +		return SIGKILL;
> +	pagefault_out_of_memory();
> +	return 0;

Do we really want to return 0 and indicate that the fault was handled?  It 
seems more consistent to do

	if (user_mode(regs))
		pagefault_out_of_memory();
	return SIGKILL;

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 11/14] powerpc: invoke oom-killer from page fault
@ 2010-04-22 21:44     ` David Rientjes
  0 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-22 21:44 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, linuxppc-dev, Andrew Morton

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linuxppc-dev@ozlabs.org
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/powerpc/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/mm/fault.c
> +++ linux-2.6/arch/powerpc/mm/fault.c
> @@ -359,15 +359,10 @@ bad_area_nosemaphore:
>   */
>  out_of_memory:
>  	up_read(&mm->mmap_sem);
> -	if (is_global_init(current)) {
> -		yield();
> -		down_read(&mm->mmap_sem);
> -		goto survive;
> -	}
> -	printk("VM: killing process %s\n", current->comm);
> -	if (user_mode(regs))
> -		do_group_exit(SIGKILL);
> -	return SIGKILL;
> +	if (!user_mode(regs))
> +		return SIGKILL;
> +	pagefault_out_of_memory();
> +	return 0;

Do we really want to return 0 and indicate that the fault was handled?  It 
seems more consistent to do

	if (user_mode(regs))
		pagefault_out_of_memory();
	return SIGKILL;

^ permalink raw reply	[flat|nested] 50+ messages in thread

* RE: [patch 03/14] cris: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 03/14] cris: " npiggin
  2010-04-22 20:50   ` David Rientjes
@ 2010-04-23  4:33   ` Mikael Starvik
  1 sibling, 0 replies; 50+ messages in thread
From: Mikael Starvik @ 2010-04-23  4:33 UTC (permalink / raw)
  To: npiggin, linux-arch; +Cc: David Rientjes, Andrew Morton, linux-cris-kernel

Signed-off-by: Mikael Starvik <starvik@axis.com>

-----Original Message-----
From: npiggin@suse.de [mailto:npiggin@suse.de] 
Sent: den 22 april 2010 18:06
To: linux-arch@vger.kernel.org
Cc: David Rientjes; Andrew Morton; linux-cris-kernel; Mikael Starvik
Subject: [patch 03/14] cris: invoke oom-killer from page fault

As explained in commit 1c0fe6e3bd, we want to call the architecture independent
oom killer when getting an unexplained OOM from handle_mm_fault, rather than
simply killing current.

Cc: linux-cris-kernel@axis.com
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/arch/cris/mm/fault.c
===================================================================
--- linux-2.6.orig/arch/cris/mm/fault.c
+++ linux-2.6/arch/cris/mm/fault.c
@@ -245,10 +245,10 @@ do_page_fault(unsigned long address, str
 
  out_of_memory:
 	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);

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 08/14] microblaze: invoke oom-killer from page fault
  2010-04-22 20:54   ` David Rientjes
@ 2010-04-23  6:30     ` Michal Simek
  0 siblings, 0 replies; 50+ messages in thread
From: Michal Simek @ 2010-04-23  6:30 UTC (permalink / raw)
  To: David Rientjes; +Cc: npiggin, linux-arch, Andrew Morton, microblaze-uclinux

David Rientjes wrote:
> On Fri, 23 Apr 2010, npiggin@suse.de wrote:
> 
>> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
>> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
>> simply killing current.
>>
>> Cc: microblaze-uclinux@itee.uq.edu.au
>> Cc: Michal Simek <monstr@monstr.eu>
>> Cc: linux-arch@vger.kernel.org
>> Signed-off-by: Nick Piggin <npiggin@suse.de>
> 
> Acked-by: David Rientjes <rientjes@google.com>

Applied to microblaze repository.

Thanks,
Michal



-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 07/14] m68k: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 07/14] m68k: " npiggin
  2010-04-22 20:53   ` David Rientjes
@ 2010-04-23  7:21   ` Geert Uytterhoeven
  1 sibling, 0 replies; 50+ messages in thread
From: Geert Uytterhoeven @ 2010-04-23  7:21 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, David Rientjes, Andrew Morton, linux-m68k

On Thu, Apr 22, 2010 at 18:06,  <npiggin@suse.de> wrote:
> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
>
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/m68k/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/m68k/mm/fault.c
> +++ linux-2.6/arch/m68k/mm/fault.c
> @@ -180,15 +180,10 @@ good_area:
>  */
>  out_of_memory:
>        up_read(&mm->mmap_sem);
> -       if (is_global_init(current)) {
> -               yield();
> -               down_read(&mm->mmap_sem);
> -               goto survive;
> -       }
> -
> -       printk("VM: killing process %s\n", current->comm);
> -       if (user_mode(regs))
> -               do_group_exit(SIGKILL);
> +       if (!user_mode(regs))
> +               goto no_context;
> +       pagefault_out_of_memory();
> +       return;
>
>  no_context:
>        current->thread.signo = SIGBUS;

Will apply after unintroducing 2 compiler warnings::

diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index 0adfcb6..2db6099 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -140,7 +140,6 @@ good_area:
 	 * the fault.
 	 */

- survive:
 	fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
 #ifdef DEBUG
 	printk("handle_mm_fault returns %d\n",fault);
@@ -169,7 +168,7 @@ out_of_memory:
 	if (!user_mode(regs))
 		goto no_context;
 	pagefault_out_of_memory();
-	return;
+	return 0;

 no_context:
 	current->thread.signo = SIGBUS;

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [patch 02/14] avr32: invoke oom-killer from page fault
  2010-04-22 20:45   ` David Rientjes
@ 2010-04-23 10:23     ` Nick Piggin
  0 siblings, 0 replies; 50+ messages in thread
From: Nick Piggin @ 2010-04-23 10:23 UTC (permalink / raw)
  To: David Rientjes; +Cc: linux-arch, Andrew Morton, Haavard Skinnemoen

On Thu, Apr 22, 2010 at 01:45:56PM -0700, David Rientjes wrote:
> On Fri, 23 Apr 2010, npiggin@suse.de wrote:
> 
> > As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> > oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> > simply killing current.
> > 
> > Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
> > Cc: linux-arch@vger.kernel.org
> > Signed-off-by: Nick Piggin <npiggin@suse.de>
> > ---
> > Index: linux-2.6/arch/avr32/mm/fault.c
> > ===================================================================
> > --- linux-2.6.orig/arch/avr32/mm/fault.c
> > +++ linux-2.6/arch/avr32/mm/fault.c
> > @@ -211,15 +211,10 @@ no_context:
> >  	 */
> >  out_of_memory:
> >  	up_read(&mm->mmap_sem);
> > -	if (is_global_init(current)) {
> > -		yield();
> > -		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;
> > +	pagefault_out_of_memory();
> > +	if (!user_mode(regs))
> > +		goto no_context;
> 
> We want to test for !user_mode(regs) before calling 
> pagefault_out_of_memory().

Thanks for the careful review. We do indeed.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 11/14] powerpc: invoke oom-killer from page fault
  2010-04-22 21:44     ` David Rientjes
@ 2010-04-23 10:27       ` Nick Piggin
  -1 siblings, 0 replies; 50+ messages in thread
From: Nick Piggin @ 2010-04-23 10:27 UTC (permalink / raw)
  To: David Rientjes
  Cc: linux-arch, Andrew Morton, linuxppc-dev, Benjamin Herrenschmidt

On Thu, Apr 22, 2010 at 02:44:22PM -0700, David Rientjes wrote:
> On Fri, 23 Apr 2010, npiggin@suse.de wrote:
> 
> > As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> > oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> > simply killing current.
> > 
> > Cc: linuxppc-dev@ozlabs.org
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: linux-arch@vger.kernel.org
> > Signed-off-by: Nick Piggin <npiggin@suse.de>
> > ---
> > Index: linux-2.6/arch/powerpc/mm/fault.c
> > ===================================================================
> > --- linux-2.6.orig/arch/powerpc/mm/fault.c
> > +++ linux-2.6/arch/powerpc/mm/fault.c
> > @@ -359,15 +359,10 @@ bad_area_nosemaphore:
> >   */
> >  out_of_memory:
> >  	up_read(&mm->mmap_sem);
> > -	if (is_global_init(current)) {
> > -		yield();
> > -		down_read(&mm->mmap_sem);
> > -		goto survive;
> > -	}
> > -	printk("VM: killing process %s\n", current->comm);
> > -	if (user_mode(regs))
> > -		do_group_exit(SIGKILL);
> > -	return SIGKILL;
> > +	if (!user_mode(regs))
> > +		return SIGKILL;
> > +	pagefault_out_of_memory();
> > +	return 0;
> 
> Do we really want to return 0 and indicate that the fault was handled?  It 
> seems more consistent to do
> 
> 	if (user_mode(regs))
> 		pagefault_out_of_memory();
> 	return SIGKILL;

Well we don't necessarily want to kill current.
pagefault_out_of_memory() could elect to send a SIGKILL if wants to, but
if it decides current should not be terminated, then we have to just
retry the page fault.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 11/14] powerpc: invoke oom-killer from page fault
@ 2010-04-23 10:27       ` Nick Piggin
  0 siblings, 0 replies; 50+ messages in thread
From: Nick Piggin @ 2010-04-23 10:27 UTC (permalink / raw)
  To: David Rientjes; +Cc: linux-arch, linuxppc-dev, Andrew Morton

On Thu, Apr 22, 2010 at 02:44:22PM -0700, David Rientjes wrote:
> On Fri, 23 Apr 2010, npiggin@suse.de wrote:
> 
> > As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> > oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> > simply killing current.
> > 
> > Cc: linuxppc-dev@ozlabs.org
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: linux-arch@vger.kernel.org
> > Signed-off-by: Nick Piggin <npiggin@suse.de>
> > ---
> > Index: linux-2.6/arch/powerpc/mm/fault.c
> > ===================================================================
> > --- linux-2.6.orig/arch/powerpc/mm/fault.c
> > +++ linux-2.6/arch/powerpc/mm/fault.c
> > @@ -359,15 +359,10 @@ bad_area_nosemaphore:
> >   */
> >  out_of_memory:
> >  	up_read(&mm->mmap_sem);
> > -	if (is_global_init(current)) {
> > -		yield();
> > -		down_read(&mm->mmap_sem);
> > -		goto survive;
> > -	}
> > -	printk("VM: killing process %s\n", current->comm);
> > -	if (user_mode(regs))
> > -		do_group_exit(SIGKILL);
> > -	return SIGKILL;
> > +	if (!user_mode(regs))
> > +		return SIGKILL;
> > +	pagefault_out_of_memory();
> > +	return 0;
> 
> Do we really want to return 0 and indicate that the fault was handled?  It 
> seems more consistent to do
> 
> 	if (user_mode(regs))
> 		pagefault_out_of_memory();
> 	return SIGKILL;

Well we don't necessarily want to kill current.
pagefault_out_of_memory() could elect to send a SIGKILL if wants to, but
if it decides current should not be terminated, then we have to just
retry the page fault.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 04/14] frv: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (13 preceding siblings ...)
  2010-04-22 16:06 ` [patch 14/14] xtensa: " npiggin
@ 2010-04-23 16:46 ` David Howells
  2010-04-23 16:46 ` [patch 09/14] mn10300: " David Howells
  15 siblings, 0 replies; 50+ messages in thread
From: David Howells @ 2010-04-23 16:46 UTC (permalink / raw)
  To: npiggin; +Cc: dhowells, linux-arch, David Rientjes, Andrew Morton

npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture
> independent oom killer when getting an unexplained OOM from handle_mm_fault,
> rather than simply killing current.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 09/14] mn10300: invoke oom-killer from page fault
  2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
                   ` (14 preceding siblings ...)
  2010-04-23 16:46 ` [patch 04/14] frv: " David Howells
@ 2010-04-23 16:46 ` David Howells
  15 siblings, 0 replies; 50+ messages in thread
From: David Howells @ 2010-04-23 16:46 UTC (permalink / raw)
  To: npiggin
  Cc: dhowells, linux-arch, David Rientjes, Andrew Morton, linux-am33-list

npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture
> independent oom killer when getting an unexplained OOM from handle_mm_fault,
> rather than simply killing current.
> 
> Cc: linux-am33-list@redhat.com
> Cc: David Howells <dhowells@redhat.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 13/14] sh: invoke oom-killer from page fault
  2010-04-22 16:06   ` npiggin
@ 2010-04-26  6:46     ` Paul Mundt
  -1 siblings, 0 replies; 50+ messages in thread
From: Paul Mundt @ 2010-04-26  6:46 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, David Rientjes, Andrew Morton, linux-sh

On Fri, Apr 23, 2010 at 02:06:26AM +1000, npiggin@suse.de wrote:
> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-sh@vger.kernel.org
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Applied with David's Acked-by, thanks.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 13/14] sh: invoke oom-killer from page fault
@ 2010-04-26  6:46     ` Paul Mundt
  0 siblings, 0 replies; 50+ messages in thread
From: Paul Mundt @ 2010-04-26  6:46 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, David Rientjes, Andrew Morton, linux-sh

On Fri, Apr 23, 2010 at 02:06:26AM +1000, npiggin@suse.de wrote:
> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-sh@vger.kernel.org
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Applied with David's Acked-by, thanks.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 10/14] parisc: invoke oom-killer from page fault
  2010-04-22 20:56   ` David Rientjes
@ 2010-04-26 15:00     ` Kyle McMartin
  0 siblings, 0 replies; 50+ messages in thread
From: Kyle McMartin @ 2010-04-26 15:00 UTC (permalink / raw)
  To: David Rientjes
  Cc: npiggin, linux-arch, Andrew Morton, linux-parisc, Kyle McMartin

On Thu, Apr 22, 2010 at 01:56:26PM -0700, David Rientjes wrote:
> On Fri, 23 Apr 2010, npiggin@suse.de wrote:
> 
> > As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> > oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> > simply killing current.
> > 
> > Cc: linux-parisc@vger.kernel.org
> > Cc: Kyle McMartin <kyle@mcmartin.ca>
> > Cc: linux-arch@vger.kernel.org
> > Signed-off-by: Nick Piggin <npiggin@suse.de>
> 
> Acked-by: David Rientjes <rientjes@google.com>

Thanks, applied.

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 01/14] alpha: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
  2010-04-22 20:46   ` David Rientjes
@ 2010-04-26 20:32   ` David Rientjes
  2010-04-28  2:58   ` Matt Turner
  2 siblings, 0 replies; 50+ messages in thread
From: David Rientjes @ 2010-04-26 20:32 UTC (permalink / raw)
  To: npiggin; +Cc: linux-arch, Andrew Morton, linux-alpha, Richard Henderson

On Fri, 23 Apr 2010, npiggin@suse.de wrote:

> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
> 
> Cc: linux-alpha@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 01/14] alpha: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
  2010-04-22 20:46   ` David Rientjes
  2010-04-26 20:32   ` David Rientjes
@ 2010-04-28  2:58   ` Matt Turner
  2010-04-28  3:30     ` Matt Turner
  2 siblings, 1 reply; 50+ messages in thread
From: Matt Turner @ 2010-04-28  2:58 UTC (permalink / raw)
  To: npiggin
  Cc: linux-arch, David Rientjes, Andrew Morton, linux-alpha,
	Richard Henderson

On Thu, Apr 22, 2010 at 12:06 PM,  <npiggin@suse.de> wrote:
> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
> simply killing current.
>
> Cc: linux-alpha@vger.kernel.org
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/alpha/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/alpha/mm/fault.c
> +++ linux-2.6/arch/alpha/mm/fault.c
> @@ -188,16 +188,10 @@ do_page_fault(unsigned long address, uns
>        /* We ran out of memory, or some other thing happened to us that
>           made us unable to handle the page fault gracefully.  */
>  out_of_memory:
> -       if (is_global_init(current)) {
> -               yield();
> -               down_read(&mm->mmap_sem);
> -               goto survive;
> -       }
> -       printk(KERN_ALERT "VM: killing process %s(%d)\n",
> -              current->comm, task_pid_nr(current));
>        if (!user_mode(regs))
>                goto no_context;
> -       do_group_exit(SIGKILL);
> +       pagefault_out_of_memory();
> +       return;
>
>  do_sigbus:
>        /* Send a sigbus, regardless of whether we were in kernel
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-alpha" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Thanks, added to my tree.

Matt

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 01/14] alpha: invoke oom-killer from page fault
  2010-04-28  2:58   ` Matt Turner
@ 2010-04-28  3:30     ` Matt Turner
  0 siblings, 0 replies; 50+ messages in thread
From: Matt Turner @ 2010-04-28  3:30 UTC (permalink / raw)
  To: npiggin
  Cc: linux-arch, David Rientjes, Andrew Morton, linux-alpha,
	Richard Henderson

On Tue, Apr 27, 2010 at 10:58 PM, Matt Turner <mattst88@gmail.com> wrote:
> On Thu, Apr 22, 2010 at 12:06 PM,  <npiggin@suse.de> wrote:
>> As explained in commit 1c0fe6e3bd, we want to call the architecture independent
>> oom killer when getting an unexplained OOM from handle_mm_fault, rather than
>> simply killing current.
>>
>> Cc: linux-alpha@vger.kernel.org
>> Cc: Richard Henderson <rth@twiddle.net>
>> Cc: linux-arch@vger.kernel.org
>> Signed-off-by: Nick Piggin <npiggin@suse.de>
>> ---
>> Index: linux-2.6/arch/alpha/mm/fault.c
>> ===================================================================
>> --- linux-2.6.orig/arch/alpha/mm/fault.c
>> +++ linux-2.6/arch/alpha/mm/fault.c
>> @@ -188,16 +188,10 @@ do_page_fault(unsigned long address, uns
>>        /* We ran out of memory, or some other thing happened to us that
>>           made us unable to handle the page fault gracefully.  */
>>  out_of_memory:
>> -       if (is_global_init(current)) {
>> -               yield();
>> -               down_read(&mm->mmap_sem);
>> -               goto survive;
>> -       }
>> -       printk(KERN_ALERT "VM: killing process %s(%d)\n",
>> -              current->comm, task_pid_nr(current));
>>        if (!user_mode(regs))
>>                goto no_context;
>> -       do_group_exit(SIGKILL);
>> +       pagefault_out_of_memory();
>> +       return;
>>
>>  do_sigbus:
>>        /* Send a sigbus, regardless of whether we were in kernel
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-alpha" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> Thanks, added to my tree.
>
> Matt
>

FYI: I had to kill off the now unused 'survive' label. Please check
this in my tree at
http://git.kernel.org/?p=linux/kernel/git/mattst88/alpha-2.6.git;a=summary
to make sure it's correct.

Matt

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [patch 12/14] score: invoke oom-killer from page fault
  2010-04-22 16:06 ` [patch 12/14] score: " npiggin
  2010-04-22 20:57   ` David Rientjes
@ 2010-04-28  7:30   ` liqin.chen
  1 sibling, 0 replies; 50+ messages in thread
From: liqin.chen @ 2010-04-28  7:30 UTC (permalink / raw)
  To: npiggin; +Cc: Andrew Morton, Lennox Wu, linux-arch, David Rientjes

npiggin@suse.de 写于 2010-04-23 00:06:25:

> As explained in commit 1c0fe6e3bd, we want to call the architecture 
independent
> oom killer when getting an unexplained OOM from handle_mm_fault, rather 
than
> simply killing current.
> 
> Cc: Chen Liqin <liqin.chen@sunplusct.com>
> Cc: Lennox Wu <lennox.wu@gmail.com>
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Nick Piggin <npiggin@suse.de>
> ---
> Index: linux-2.6/arch/score/mm/fault.c
> ===================================================================
> --- linux-2.6.orig/arch/score/mm/fault.c
> +++ linux-2.6/arch/score/mm/fault.c
> @@ -167,15 +167,10 @@ no_context:
>     */
>  out_of_memory:
>     up_read(&mm->mmap_sem);
> -   if (is_global_init(tsk)) {
> -      yield();
> -      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);
> 
> 

Thanks, commited to score repository.

liqin


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2010-04-28  7:49 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-22 16:06 [patch 00/14] convert remaining architectures to pagefault_out_of_memory() npiggin
2010-04-22 16:06 ` [patch 01/14] alpha: invoke oom-killer from page fault npiggin
2010-04-22 20:46   ` David Rientjes
2010-04-26 20:32   ` David Rientjes
2010-04-28  2:58   ` Matt Turner
2010-04-28  3:30     ` Matt Turner
2010-04-22 16:06 ` [patch 02/14] avr32: " npiggin
2010-04-22 20:45   ` David Rientjes
2010-04-23 10:23     ` Nick Piggin
2010-04-22 16:06 ` [patch 03/14] cris: " npiggin
2010-04-22 20:50   ` David Rientjes
2010-04-23  4:33   ` Mikael Starvik
2010-04-22 16:06 ` [patch 04/14] frv: " npiggin
2010-04-22 20:50   ` David Rientjes
2010-04-22 16:06 ` [patch 05/14] ia64: " npiggin
2010-04-22 16:06   ` npiggin
2010-04-22 20:51   ` David Rientjes
2010-04-22 20:51     ` David Rientjes
2010-04-22 16:06 ` [patch 06/14] m32r: " npiggin
2010-04-22 20:52   ` David Rientjes
2010-04-22 16:06 ` [patch 07/14] m68k: " npiggin
2010-04-22 20:53   ` David Rientjes
2010-04-23  7:21   ` Geert Uytterhoeven
2010-04-22 16:06 ` [patch 08/14] microblaze: " npiggin
2010-04-22 20:54   ` David Rientjes
2010-04-23  6:30     ` Michal Simek
2010-04-22 16:06 ` [patch 09/14] mn10300: " npiggin
2010-04-22 16:06 ` [patch 10/14] parisc: " npiggin
2010-04-22 16:06   ` npiggin
2010-04-22 20:56   ` David Rientjes
2010-04-26 15:00     ` Kyle McMartin
2010-04-22 16:06 ` [patch 11/14] powerpc: " npiggin
2010-04-22 16:06   ` npiggin
2010-04-22 21:44   ` David Rientjes
2010-04-22 21:44     ` David Rientjes
2010-04-23 10:27     ` Nick Piggin
2010-04-23 10:27       ` Nick Piggin
2010-04-22 16:06 ` [patch 12/14] score: " npiggin
2010-04-22 20:57   ` David Rientjes
2010-04-28  7:30   ` liqin.chen
2010-04-22 16:06 ` [patch 13/14] sh: " npiggin
2010-04-22 16:06   ` npiggin
2010-04-22 20:58   ` David Rientjes
2010-04-22 20:58     ` David Rientjes
2010-04-26  6:46   ` Paul Mundt
2010-04-26  6:46     ` Paul Mundt
2010-04-22 16:06 ` [patch 14/14] xtensa: " npiggin
2010-04-22 20:58   ` David Rientjes
2010-04-23 16:46 ` [patch 04/14] frv: " David Howells
2010-04-23 16:46 ` [patch 09/14] mn10300: " David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.