aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-01-07 21:08:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:08 -0500
commit14797e2363c2b2f1ce139fd1c5a215e4e05aa1d9 (patch)
treea56edaa680c7c338a5a3043aa24897d7f668b6c9 /include/linux/memcontrol.h
parent549927620b04a8f8073ce2ee2a8977f209af2ee5 (diff)
memcg: add inactive_anon_is_low()
The inactive_anon_is_low() is key component of active/inactive anon balancing on reclaim. However current inactive_anon_is_low() function only consider global reclaim. Therefore, we need following ugly scan_global_lru() condition. if (lru == LRU_ACTIVE_ANON && (!scan_global_lru(sc) || inactive_anon_is_low(zone))) { shrink_active_list(nr_to_scan, zone, sc, priority, file); return 0; it cause that memcg reclaim always deactivate pages when shrink_list() is called. To make mem_cgroup_inactive_anon_is_low() improve active/inactive anon balancing of memcgroup. 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: Cyrill Gorcunov <gorcunov@gmail.com> Cc: "Pekka Enberg" <penberg@cs.helsinki.fi> 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: 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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 59ac95a64508..aad9377c9828 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -100,6 +100,8 @@ extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
100 100
101extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone, 101extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone,
102 int priority, enum lru_list lru); 102 int priority, enum lru_list lru);
103int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg,
104 struct zone *zone);
103 105
104#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 106#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
105extern int do_swap_account; 107extern int do_swap_account;
@@ -251,6 +253,13 @@ static inline bool mem_cgroup_oom_called(struct task_struct *task)
251{ 253{
252 return false; 254 return false;
253} 255}
256
257static inline int
258mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone)
259{
260 return 1;
261}
262
254#endif /* CONFIG_CGROUP_MEM_CONT */ 263#endif /* CONFIG_CGROUP_MEM_CONT */
255 264
256#endif /* _LINUX_MEMCONTROL_H */ 265#endif /* _LINUX_MEMCONTROL_H */