aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-01-07 21:08:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:09 -0500
commitc772be939e078afd2505ede7d596a30f8f61de95 (patch)
tree2cf3157fdd2b3570e105f2d91576585750526fb3 /include/linux/memcontrol.h
parenta7885eb8ad465ec9db99ac5b5e6680f0ca8e11c8 (diff)
memcg: fix calculation of active_ratio
Currently, inactive_ratio of memcg is calculated at setting limit. because page_alloc.c does so and current implementation is straightforward porting. However, memcg introduced hierarchy feature recently. In hierarchy restriction, memory limit is not only decided memory.limit_in_bytes of current cgroup, but also parent limit and sibling memory usage. Then, The optimal inactive_ratio is changed frequently. So, everytime calculation is better. Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.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.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 8752052da8df..056cf82c0e86 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -97,8 +97,7 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
97 int priority); 97 int priority);
98extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, 98extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
99 int priority); 99 int priority);
100int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, 100int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
101 struct zone *zone);
102unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, 101unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
103 struct zone *zone, 102 struct zone *zone,
104 enum lru_list lru); 103 enum lru_list lru);
@@ -252,7 +251,7 @@ static inline bool mem_cgroup_oom_called(struct task_struct *task)
252} 251}
253 252
254static inline int 253static inline int
255mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone) 254mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
256{ 255{
257 return 1; 256 return 1;
258} 257}