aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-02-07 03:13:56 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:18 -0500
commit66e1707bc34609f626e2e7b4fe7e454c9748bad5 (patch)
treed850a729887485874c976ba64eb85e3406e488a1 /include/linux/memcontrol.h
parent67e465a77ba658635309ee00b367bec6555ea544 (diff)
Memory controller: add per cgroup LRU and reclaim
Add the page_cgroup to the per cgroup LRU. The reclaim algorithm has been modified to make the isolate_lru_pages() as a pluggable component. The scan_control data structure now accepts the cgroup on behalf of which reclaims are carried out. try_to_free_pages() has been extended to become cgroup aware. [akpm@linux-foundation.org: fix warning] [Lee.Schermerhorn@hp.com: initialize all scan_control's isolate_pages member] [bunk@kernel.org: make do_try_to_free_pages() static] [hugh@veritas.com: memcgroup: fix try_to_free order] [kamezawa.hiroyu@jp.fujitsu.com: this unlock_page_cgroup() is unnecessary] Signed-off-by: Pavel Emelianov <xemul@openvz.org> Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Paul Menage <menage@google.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Kirill Korotaev <dev@sw.ru> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: David Rientjes <rientjes@google.com> Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@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.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index f5b47efab48b..9c3c1c97c197 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -32,6 +32,13 @@ extern void page_assign_page_cgroup(struct page *page,
32extern struct page_cgroup *page_get_page_cgroup(struct page *page); 32extern struct page_cgroup *page_get_page_cgroup(struct page *page);
33extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm); 33extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm);
34extern void mem_cgroup_uncharge(struct page_cgroup *pc); 34extern void mem_cgroup_uncharge(struct page_cgroup *pc);
35extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active);
36extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
37 struct list_head *dst,
38 unsigned long *scanned, int order,
39 int mode, struct zone *z,
40 struct mem_cgroup *mem_cont,
41 int active);
35 42
36static inline void mem_cgroup_uncharge_page(struct page *page) 43static inline void mem_cgroup_uncharge_page(struct page *page)
37{ 44{
@@ -71,6 +78,11 @@ static inline void mem_cgroup_uncharge_page(struct page *page)
71{ 78{
72} 79}
73 80
81static inline void mem_cgroup_move_lists(struct page_cgroup *pc,
82 bool active)
83{
84}
85
74#endif /* CONFIG_CGROUP_MEM_CONT */ 86#endif /* CONFIG_CGROUP_MEM_CONT */
75 87
76#endif /* _LINUX_MEMCONTROL_H */ 88#endif /* _LINUX_MEMCONTROL_H */