aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/oom.h
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2007-10-17 02:25:55 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:45 -0400
commit098d7f128a4e53cb64930628915ac767785e0e60 (patch)
treeed3cab1daecab7f2a64b27deed190df3ec218789 /include/linux/oom.h
parente815af95f94914993bbad279c71cf5fef9f4eaac (diff)
oom: add per-zone locking
OOM killer synchronization should be done with zone granularity so that memory policy and cpuset allocations may have their corresponding zones locked and allow parallel kills for other OOM conditions that may exist elsewhere in the system. DMA allocations can be targeted at the zone level, which would not be possible if locking was done in nodes or globally. Synchronization shall be done with a variation of "trylocks." The goal is to put the current task to sleep and restart the failed allocation attempt later if the trylock fails. Otherwise, the OOM killer is invoked. Each zone in the zonelist that __alloc_pages() was called with is checked for the newly-introduced ZONE_OOM_LOCKED flag. If any zone has this flag present, the "trylock" to serialize the OOM killer fails and returns zero. Otherwise, all the zones have ZONE_OOM_LOCKED set and the try_set_zone_oom() function returns non-zero. Cc: Andrea Arcangeli <andrea@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/oom.h')
-rw-r--r--include/linux/oom.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h
index cf6ebf5b422c..e9081200cdb7 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -20,6 +20,9 @@ enum oom_constraint {
20 CONSTRAINT_MEMORY_POLICY, 20 CONSTRAINT_MEMORY_POLICY,
21}; 21};
22 22
23extern int try_set_zone_oom(struct zonelist *zonelist);
24extern void clear_zonelist_oom(struct zonelist *zonelist);
25
23extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); 26extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
24extern int register_oom_notifier(struct notifier_block *nb); 27extern int register_oom_notifier(struct notifier_block *nb);
25extern int unregister_oom_notifier(struct notifier_block *nb); 28extern int unregister_oom_notifier(struct notifier_block *nb);