convert remaining architectures to pagefault_out_of_memory()
Subsystems (8)
PATCH 1/14 alpha: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/alpha/mm/fault.c +2 -8
@@ -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
PATCH 5/14 ia64: invoke oom-killer from page fault
In reply to [email protected]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.
---
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();
}
PATCH 7/14 m68k: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/m68k/mm/fault.c +4 -9
@@ -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 ;
PATCH 10/14 parisc: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/parisc/mm/fault.c +3 -4
@@ -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 (); }
PATCH 13/14 sh: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/sh/mm/fault_32.c +4 -9
@@ -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);
arch/sh/mm/tlbflush_64.c +4 -15
@@ -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" );
cover convert remaining architectures to pagefault_out_of_memory()
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
PATCH 3/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.
---
arch/cris/mm/fault.c +4 -4
@@ -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);
PATCH 4/14 frv: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/frv/mm/fault.c +4 -4
@@ -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);
PATCH 9/14 mn10300: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/mn10300/mm/fault.c +4 -5
@@ -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);
PATCH 8/14 microblaze: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/microblaze/mm/fault.c +4 -9
@@ -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:
PATCH 2/14 avr32: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/avr32/mm/fault.c +4 -9
@@ -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);
PATCH 12/14 score: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/score/mm/fault.c +4 -9
@@ -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);
PATCH 6/14 m32r: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/m32r/mm/fault.c +3 -8
@@ -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);
PATCH 11/14 powerpc: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/powerpc/mm/fault.c +4 -9
@@ -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);
PATCH 14/14 xtensa: invoke oom-killer from page fault
In reply to [email protected]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.
---
arch/xtensa/mm/fault.c +4 -9
@@ -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:
Re: [patch 02/14] avr32: invoke oom-killer from page fault
In reply to [email protected]Quoted 18 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Haavard Skinnemoen <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/avr32/mm/fault.c
===================================================================arch/avr32/mm/fault.c +0
-2@@ -211,15 +211,10 @@ no_context:*/ out_of_memory:up_read (&mm->mmap_sem); -if (is_global_init (current)) { -yield ();
arch/avr32/mm/fault.c no_context: · line 216
Quoted 10 lines
arch/avr32/mm/fault.c +3
-7-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().
Quoted 4 lines
arch/avr32/mm/fault.c +1
-0+return ; do_sigbus:up_read (&mm->mmap_sem);
Re: [patch 01/14] alpha: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Richard Henderson <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 03/14] cris: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Mikael Starvik <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 04/14] frv: invoke oom-killer from page fault
In reply to [email protected]Quoted 7 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc David Howells <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 05/14] ia64: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Tony Luck <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Quoted 24 lines
---
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(quoted diff) +3
-9@@ -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(); }
Re: [patch 06/14] m32r: invoke oom-killer from page fault
In reply to [email protected]Quoted 14 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Hirokazu Takata <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/m32r/mm/fault.c
===================================================================
arch/m32r/mm/fault.c no_context: · line 274
Quoted 10 lines
arch/m32r/mm/fault.c +0
-6@@ -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.
Quoted 11 lines
arch/m32r/mm/fault.c +3
-2-do_group_exit (SIGKILL ); - goto no_context; + goto no_context; +pagefault_out_of_memory (); +return ; do_sigbus:up_read (&mm->mmap_sem);
Re: [patch 07/14] m68k: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Geert Uytterhoeven <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 08/14] microblaze: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Michal Simek <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 10/14] parisc: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Kyle McMartin <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 12/14] score: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Chen Liqin <[email protected]>Cc Lennox Wu <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 13/14] sh: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Paul Mundt <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 14/14] xtensa: invoke oom-killer from page fault
In reply to [email protected]Quoted 7 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Chris Zankel <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 11/14] powerpc: invoke oom-killer from page fault
In reply to [email protected]Quoted 20 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Benjamin Herrenschmidt <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/powerpc/mm/fault.c
===================================================================arch/powerpc/mm/fault.c +0
-3@@ -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);
arch/powerpc/mm/fault.c bad_area_nosemaphore: · line 365
Quoted 10 lines
arch/powerpc/mm/fault.c +4
-6- 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;
RE: [patch 03/14] cris: invoke oom-killer from page fault
In reply to [email protected]-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: den 22 april 2010 18:06
To: [email protected]
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.
---
arch/cris/mm/fault.c +4 -4
@@ -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);
Re: [patch 08/14] microblaze: invoke oom-killer from page fault
In reply to David RientjesQuoted 6 lines · David Rientjes
Quoted 4 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.
Quoted 6 lines
Quoted 4 lines
Cc Michal Simek <[email protected]>Signed-off-by Nick Piggin <[email protected]>Acked-by David Rientjes <[email protected]>
Applied to microblaze repository.
Thanks,
Michal
Signature · 4 lines
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
Geert Uytterhoeven
maintainerRe: [patch 07/14] m68k: invoke oom-killer from page fault
In reply to [email protected]Quoted 31 lines · On Thu, Apr 22, 2010 at 18:06, <[email protected]> wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Geert Uytterhoeven <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/m68k/mm/fault.c
===================================================================arch/m68k/mm/fault.c +0
-0@@ -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))
+ gotono_context;
+pagefault_out_of_memory();
+ return;
Quoted 2 lines
no_context:
current->thread.signo = SIGBUS;
Will apply after unintroducing 2 compiler warnings::
arch/m68k/mm/fault.c +1 -2
@@ -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 -- [email protected]
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
Re: [patch 02/14] avr32: invoke oom-killer from page fault
In reply to David RientjesQuoted 25 lines · David Rientjes
Quoted 23 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Haavard Skinnemoen <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/avr32/mm/fault.c
===================================================================arch/avr32/mm/fault.c +0
-7@@ -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))
Quoted 8 lines
arch/avr32/mm/fault.c no_context: · line 216
Quoted 5 lines
arch/avr32/mm/fault.c +3
-2-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.
Re: [patch 11/14] powerpc: invoke oom-killer from page fault
In reply to David RientjesQuoted 36 lines · David Rientjes
Quoted 20 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Benjamin Herrenschmidt <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/powerpc/mm/fault.c
===================================================================arch/powerpc/mm/fault.c +0
-3@@ -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);arch/powerpc/mm/fault.c bad_area_nosemaphore: · line 365
Quoted 10 lines
arch/powerpc/mm/fault.c +4
-6- 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
Quoted 3 lines
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.
Re: [patch 04/14] frv: invoke oom-killer from page fault
In reply to [email protected]Quoted 7 lines · [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc David Howells <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 09/14] mn10300: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc David Howells <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Re: [patch 13/14] sh: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, Apr 23, 2010 at 02:06:26AM +1000, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Paul Mundt <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Applied with David's Acked-by, thanks.
Kyle McMartin
AppliedRe: [patch 10/14] parisc: invoke oom-killer from page fault
In reply to David RientjesQuoted 6 lines · David Rientjes
Quoted 4 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.
Quoted 6 lines
Quoted 4 lines
Cc Kyle McMartin <[email protected]>Signed-off-by Nick Piggin <[email protected]>Acked-by David Rientjes <[email protected]>
Thanks, applied.
Re: [patch 01/14] alpha: invoke oom-killer from page fault
In reply to [email protected]Quoted 8 lines · On Fri, 23 Apr 2010, [email protected] wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Richard Henderson <[email protected]>Signed-off-by Nick Piggin <[email protected]>
Matt Turner
maintainerRe: [patch 01/14] alpha: invoke oom-killer from page fault
In reply to [email protected]Quoted 30 lines · On Thu, Apr 22, 2010 at 12:06 PM, <[email protected]> wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Richard Henderson <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/alpha/mm/fault.c
===================================================================arch/alpha/mm/fault.c +0
-0@@ -188,16 +188,10 @@ do_page_fault(unsigned long address, uns /* We ran out of memory, or some other thing happened to us thatmade 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))
gotono_context;
-do_group_exit(SIGKILL);
+pagefault_out_of_memory();
+ return;
Quoted 9 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks, added to my tree.
Matt
Matt Turner
maintainerRe: [patch 01/14] alpha: invoke oom-killer from page fault
Quoted 43 lines · Matt Turner
Quoted 30 lines · On Thu, Apr 22, 2010 at 12:06 PM, <[email protected]> wrote:
As explained in commit
1c0fe6e3bd, we want to call the architecture independent oom killer when getting an unexplained OOM fromhandle_mm_fault, rather than simply killing current.Cc Richard Henderson <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/alpha/mm/fault.c
===================================================================arch/alpha/mm/fault.c +0
-0@@ -188,16 +188,10 @@ do_page_fault(unsigned long address, uns /* We ran out of memory, or some other thing happened to us thatmade 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))
gotono_context;
-do_group_exit(SIGKILL);
+pagefault_out_of_memory();
+ return;Quoted 9 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlThanks, added to my tree.
Quoted 2 lines
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
Re: [patch 12/14] score: invoke oom-killer from page fault
In reply to [email protected][email protected] 写于 2010-04-23 00:06:25:
Quoted 1 line
As explained in commit
1c0fe6e3bd, we want to call the architecture
independent
Quoted 1 line
oom killer when getting an unexplained OOM from
handle_mm_fault, rather
than
Quoted 23 lines
simply killing current.
Cc Chen Liqin <[email protected]>Cc Lennox Wu <[email protected]>Signed-off-by Nick Piggin <[email protected]>---
Index:linux-2.6/arch/score/mm/fault.c
===================================================================arch/score/mm/fault.c +0
-6@@ -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);
arch/score/mm/fault.c no_context: · line 176
Quoted 10 lines
arch/score/mm/fault.c +4
-3-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