diff options
author | David Rientjes <rientjes@google.com> | 2008-02-07 03:14:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:19 -0500 |
commit | 4c4a22148909e4c003562ea7ffe0a06e26919e3c (patch) | |
tree | fa8b7d00e89f0eb4cdb4394dbc74d898810519aa /include/linux/memcontrol.h | |
parent | 4c6bc8dd5a0932f2c0b30a5f0a124464b7f614d0 (diff) |
memcontrol: move oom task exclusion to tasklist scan
Creates a helper function to return non-zero if a task is a member of a
memory controller:
int task_in_mem_cgroup(const struct task_struct *task,
const struct mem_cgroup *mem);
When the OOM killer is constrained by the memory controller, the exclusion
of tasks that are not a member of that controller was previously misplaced
and appeared in the badness scoring function. It should be excluded
during the tasklist scan in select_bad_process() instead.
[akpm@linux-foundation.org: build fix]
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Balbir Singh <balbir@linux.vnet.ibm.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/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 4f580268b1b7..42536c737d9c 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -48,6 +48,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
49 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 49 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
50 | gfp_t gfp_mask); | 50 | gfp_t gfp_mask); |
51 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | ||
51 | 52 | ||
52 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | 53 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) |
53 | { | 54 | { |
@@ -110,6 +111,12 @@ static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | |||
110 | return NULL; | 111 | return NULL; |
111 | } | 112 | } |
112 | 113 | ||
114 | static inline int task_in_mem_cgroup(struct task_struct *task, | ||
115 | const struct mem_cgroup *mem) | ||
116 | { | ||
117 | return 1; | ||
118 | } | ||
119 | |||
113 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 120 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
114 | 121 | ||
115 | #endif /* _LINUX_MEMCONTROL_H */ | 122 | #endif /* _LINUX_MEMCONTROL_H */ |