oom_kill.c (664b0bae0b87f69bc9deb098f5e0158b9cf18e04) oom_kill.c (e8b098fc5747a7c871f113c9eb65453cc2d86e6f)
1/*
2 * linux/mm/oom_kill.c
3 *
4 * Copyright (C) 1998,2000 Rik van Riel
5 * Thanks go out to Claus Fischer for some serious inspiration and
6 * for goading me into coding this file...
7 * Copyright (C) 2010 Google, Inc.
8 * Rewritten by David Rientjes

--- 171 unchanged lines hidden (view full) ---

180
181 return (global_node_page_state(NR_SLAB_UNRECLAIMABLE) > nr_lru);
182}
183
184/**
185 * oom_badness - heuristic function to determine which candidate task to kill
186 * @p: task struct of which task we should calculate
187 * @totalpages: total present RAM allowed for page allocation
1/*
2 * linux/mm/oom_kill.c
3 *
4 * Copyright (C) 1998,2000 Rik van Riel
5 * Thanks go out to Claus Fischer for some serious inspiration and
6 * for goading me into coding this file...
7 * Copyright (C) 2010 Google, Inc.
8 * Rewritten by David Rientjes

--- 171 unchanged lines hidden (view full) ---

180
181 return (global_node_page_state(NR_SLAB_UNRECLAIMABLE) > nr_lru);
182}
183
184/**
185 * oom_badness - heuristic function to determine which candidate task to kill
186 * @p: task struct of which task we should calculate
187 * @totalpages: total present RAM allowed for page allocation
188 * @memcg: task's memory controller, if constrained
189 * @nodemask: nodemask passed to page allocator for mempolicy ooms
188 *
189 * The heuristic for determining which task to kill is made to be as simple and
190 * predictable as possible. The goal is to return the highest value for the
191 * task consuming the most memory to avoid subsequent oom failures.
192 */
193unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg,
194 const nodemask_t *nodemask, unsigned long totalpages)
195{

--- 918 unchanged lines hidden ---
190 *
191 * The heuristic for determining which task to kill is made to be as simple and
192 * predictable as possible. The goal is to return the highest value for the
193 * task consuming the most memory to avoid subsequent oom failures.
194 */
195unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg,
196 const nodemask_t *nodemask, unsigned long totalpages)
197{

--- 918 unchanged lines hidden ---