aboutsummaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2010-08-09 20:18:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:44:57 -0400
commitf44200320b10c76003101dee21c5f961e80faf0b (patch)
tree4c187867337cee9c02e08d926866669f27e4018c /mm/oom_kill.c
parentff321feac22313cf53ffceb69224b09ac19ff22b (diff)
oom: remove constraint argument from select_bad_process and __out_of_memory
select_bad_process() and __out_of_memory() doe not need their enum oom_constraint arguments: it's possible to pass a NULL nodemask if constraint == CONSTRAINT_MEMORY_POLICY in the caller, out_of_memory(). Signed-off-by: David Rientjes <rientjes@google.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index c29cf00d9084..cba18c06e508 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -284,8 +284,7 @@ static enum oom_constraint constrained_alloc(struct zonelist *zonelist,
284 * (not docbooked, we don't want this one cluttering up the manual) 284 * (not docbooked, we don't want this one cluttering up the manual)
285 */ 285 */
286static struct task_struct *select_bad_process(unsigned long *ppoints, 286static struct task_struct *select_bad_process(unsigned long *ppoints,
287 struct mem_cgroup *mem, enum oom_constraint constraint, 287 struct mem_cgroup *mem, const nodemask_t *nodemask)
288 const nodemask_t *mask)
289{ 288{
290 struct task_struct *p; 289 struct task_struct *p;
291 struct task_struct *chosen = NULL; 290 struct task_struct *chosen = NULL;
@@ -301,9 +300,7 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
301 continue; 300 continue;
302 if (mem && !task_in_mem_cgroup(p, mem)) 301 if (mem && !task_in_mem_cgroup(p, mem))
303 continue; 302 continue;
304 if (!has_intersects_mems_allowed(p, 303 if (!has_intersects_mems_allowed(p, nodemask))
305 constraint == CONSTRAINT_MEMORY_POLICY ? mask :
306 NULL))
307 continue; 304 continue;
308 305
309 /* 306 /*
@@ -518,7 +515,7 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
518 check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0); 515 check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0);
519 read_lock(&tasklist_lock); 516 read_lock(&tasklist_lock);
520retry: 517retry:
521 p = select_bad_process(&points, mem, CONSTRAINT_MEMCG, NULL); 518 p = select_bad_process(&points, mem, NULL);
522 if (!p || PTR_ERR(p) == -1UL) 519 if (!p || PTR_ERR(p) == -1UL)
523 goto out; 520 goto out;
524 521
@@ -635,8 +632,7 @@ static void clear_system_oom(void)
635/* 632/*
636 * Must be called with tasklist_lock held for read. 633 * Must be called with tasklist_lock held for read.
637 */ 634 */
638static void __out_of_memory(gfp_t gfp_mask, int order, 635static void __out_of_memory(gfp_t gfp_mask, int order, const nodemask_t *mask)
639 enum oom_constraint constraint, const nodemask_t *mask)
640{ 636{
641 struct task_struct *p; 637 struct task_struct *p;
642 unsigned long points; 638 unsigned long points;
@@ -650,7 +646,7 @@ retry:
650 * Rambo mode: Shoot down a process and hope it solves whatever 646 * Rambo mode: Shoot down a process and hope it solves whatever
651 * issues we may have. 647 * issues we may have.
652 */ 648 */
653 p = select_bad_process(&points, NULL, constraint, mask); 649 p = select_bad_process(&points, NULL, mask);
654 650
655 if (PTR_ERR(p) == -1UL) 651 if (PTR_ERR(p) == -1UL)
656 return; 652 return;
@@ -708,7 +704,9 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
708 constraint = constrained_alloc(zonelist, gfp_mask, nodemask); 704 constraint = constrained_alloc(zonelist, gfp_mask, nodemask);
709 check_panic_on_oom(constraint, gfp_mask, order); 705 check_panic_on_oom(constraint, gfp_mask, order);
710 read_lock(&tasklist_lock); 706 read_lock(&tasklist_lock);
711 __out_of_memory(gfp_mask, order, constraint, nodemask); 707 __out_of_memory(gfp_mask, order,
708 constraint == CONSTRAINT_MEMORY_POLICY ? nodemask :
709 NULL);
712 read_unlock(&tasklist_lock); 710 read_unlock(&tasklist_lock);
713 711
714 /* 712 /*