diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-06-15 18:08:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-15 23:03:59 -0400 |
commit | a433658c30974fc87ba3ff52d7e4e6299762aa3d (patch) | |
tree | 8df65e22af520ca5c020281763e6874d0bb51bc5 /include/linux/memcontrol.h | |
parent | e1bbd19bc4afef7adb80cca163800391c4f5773d (diff) |
vmscan,memcg: memcg aware swap token
Currently, memcg reclaim can disable swap token even if the swap token mm
doesn't belong in its memory cgroup. It's slightly risky. If an admin
creates very small mem-cgroup and silly guy runs contentious heavy memory
pressure workload, every tasks are going to lose swap token and then
system may become unresponsive. That's bad.
This patch adds 'memcg' parameter into disable_swap_token(). and if the
parameter doesn't match swap token, VM doesn't disable it.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Rik van Riel<riel@redhat.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 | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9724a38ee69d..50940da6adf3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -84,6 +84,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |||
84 | 84 | ||
85 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 85 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
86 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 86 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
87 | extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); | ||
87 | 88 | ||
88 | static inline | 89 | static inline |
89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 90 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
@@ -246,6 +247,11 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | |||
246 | return NULL; | 247 | return NULL; |
247 | } | 248 | } |
248 | 249 | ||
250 | static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) | ||
251 | { | ||
252 | return NULL; | ||
253 | } | ||
254 | |||
249 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 255 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
250 | { | 256 | { |
251 | return 1; | 257 | return 1; |