diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2009-01-07 21:08:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 11:31:08 -0500 |
commit | 3e2f41f1f64744f7942980d93cc93dd3e5924560 (patch) | |
tree | 7b605c407b7470877fd9c5c853407f75edcbeb49 /include | |
parent | a3d8e0549d913e30968fa02e505dfe02c0a23e0d (diff) |
memcg: add zone_reclaim_stat
Introduce mem_cgroup_per_zone::reclaim_stat member and its statics
collecting function.
Now, get_scan_ratio() can calculate correct value on memcg reclaim.
[hugh@veritas.com: avoid reclaim_stat oops when disabled]
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/memcontrol.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index b1defd6a2783..36b8ebb39b82 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -105,6 +105,10 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, | |||
105 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 105 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, |
106 | struct zone *zone, | 106 | struct zone *zone, |
107 | enum lru_list lru); | 107 | enum lru_list lru); |
108 | struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, | ||
109 | struct zone *zone); | ||
110 | struct zone_reclaim_stat* | ||
111 | mem_cgroup_get_reclaim_stat_from_page(struct page *page); | ||
108 | 112 | ||
109 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 113 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
110 | extern int do_swap_account; | 114 | extern int do_swap_account; |
@@ -271,6 +275,18 @@ mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | |||
271 | } | 275 | } |
272 | 276 | ||
273 | 277 | ||
278 | static inline struct zone_reclaim_stat* | ||
279 | mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, struct zone *zone) | ||
280 | { | ||
281 | return NULL; | ||
282 | } | ||
283 | |||
284 | static inline struct zone_reclaim_stat* | ||
285 | mem_cgroup_get_reclaim_stat_from_page(struct page *page) | ||
286 | { | ||
287 | return NULL; | ||
288 | } | ||
289 | |||
274 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 290 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
275 | 291 | ||
276 | #endif /* _LINUX_MEMCONTROL_H */ | 292 | #endif /* _LINUX_MEMCONTROL_H */ |