aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/oom.h9
-rw-r--r--mm/oom_kill.c12
2 files changed, 12 insertions, 9 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h
index b40bb4e32c2f..cf6ebf5b422c 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -11,6 +11,15 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14/*
15 * Types of limitations to the nodes from which allocations may occur
16 */
17enum oom_constraint {
18 CONSTRAINT_NONE,
19 CONSTRAINT_CPUSET,
20 CONSTRAINT_MEMORY_POLICY,
21};
22
14extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); 23extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
15extern int register_oom_notifier(struct notifier_block *nb); 24extern int register_oom_notifier(struct notifier_block *nb);
16extern int unregister_oom_notifier(struct notifier_block *nb); 25extern int unregister_oom_notifier(struct notifier_block *nb);
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 41b4e362221d..1a7a4ef04e27 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -164,16 +164,10 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
164} 164}
165 165
166/* 166/*
167 * Types of limitations to the nodes from which allocations may occur
168 */
169#define CONSTRAINT_NONE 1
170#define CONSTRAINT_MEMORY_POLICY 2
171#define CONSTRAINT_CPUSET 3
172
173/*
174 * Determine the type of allocation constraint. 167 * Determine the type of allocation constraint.
175 */ 168 */
176static inline int constrained_alloc(struct zonelist *zonelist, gfp_t gfp_mask) 169static inline enum oom_constraint constrained_alloc(struct zonelist *zonelist,
170 gfp_t gfp_mask)
177{ 171{
178#ifdef CONFIG_NUMA 172#ifdef CONFIG_NUMA
179 struct zone **z; 173 struct zone **z;
@@ -393,7 +387,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
393 struct task_struct *p; 387 struct task_struct *p;
394 unsigned long points = 0; 388 unsigned long points = 0;
395 unsigned long freed = 0; 389 unsigned long freed = 0;
396 int constraint; 390 enum oom_constraint constraint;
397 391
398 blocking_notifier_call_chain(&oom_notify_list, 0, &freed); 392 blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
399 if (freed > 0) 393 if (freed > 0)