diff options
author | Nick Piggin <npiggin@suse.de> | 2009-01-06 17:38:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:58:58 -0500 |
commit | 1c0fe6e3bda0464728c23c8d84aa47567e8b716c (patch) | |
tree | 64f7903ee7757b14464e8a06bf91f5c4d5a8ba56 /include/linux/mm.h | |
parent | 5bd1455c239672081d0e7f086e899b8cbc7a9844 (diff) |
mm: invoke oom-killer from page fault
Rather than have the pagefault handler kill a process directly if it gets
a VM_FAULT_OOM, have it call into the OOM killer.
With increasingly sophisticated oom behaviour (cpusets, memory cgroups,
oom killing throttling, oom priority adjustment or selective disabling,
panic on oom, etc), it's silly to unconditionally kill the faulting
process at page fault time. Create a hook for pagefault oom path to call
into instead.
Only converted x86 and uml so far.
[akpm@linux-foundation.org: make __out_of_memory() static]
[akpm@linux-foundation.org: fix comment]
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Jeff Dike <jdike@addtoit.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index aaa8b843be28..4a3d28c86443 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -717,6 +717,11 @@ static inline int page_mapped(struct page *page) | |||
717 | 717 | ||
718 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 718 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) |
719 | 719 | ||
720 | /* | ||
721 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | ||
722 | */ | ||
723 | extern void pagefault_out_of_memory(void); | ||
724 | |||
720 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 725 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
721 | 726 | ||
722 | extern void show_free_areas(void); | 727 | extern void show_free_areas(void); |