aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2006-09-26 02:31:20 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:47 -0400
commit8bc719d3cab8414938f9ea6e33b58d8810d18068 (patch)
tree1afd4ce7865466bf9578ca746c63c1d351f07cdc /include/linux/swap.h
parent19655d3487001d7df0e10e9cbfc27c758b77c2b5 (diff)
[PATCH] out of memory notifier
Add a notifer chain to the out of memory killer. If one of the registered callbacks could release some memory, do not kill the process but return and retry the allocation that forced the oom killer to run. The purpose of the notifier is to add a safety net in the presence of memory ballooners. If the resource manager inflated the balloon to a size where memory allocations can not be satisfied anymore, it is better to deflate the balloon a bit instead of killing processes. The implementation for the s390 ballooner is included. [akpm@osdl.org: cleanups] Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 34a6bc3e6cf3..32db06c8ffe0 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -10,6 +10,8 @@
10#include <asm/atomic.h> 10#include <asm/atomic.h>
11#include <asm/page.h> 11#include <asm/page.h>
12 12
13struct notifier_block;
14
13#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ 15#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
14#define SWAP_FLAG_PRIO_MASK 0x7fff 16#define SWAP_FLAG_PRIO_MASK 0x7fff
15#define SWAP_FLAG_PRIO_SHIFT 0 17#define SWAP_FLAG_PRIO_SHIFT 0
@@ -156,6 +158,8 @@ struct swap_list_t {
156 158
157/* linux/mm/oom_kill.c */ 159/* linux/mm/oom_kill.c */
158extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); 160extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
161extern int register_oom_notifier(struct notifier_block *nb);
162extern int unregister_oom_notifier(struct notifier_block *nb);
159 163
160/* linux/mm/memory.c */ 164/* linux/mm/memory.c */
161extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 165extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);