aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r--include/linux/memcontrol.h41
1 files changed, 17 insertions, 24 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 04075628cb9a..8b1c4295848b 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -25,18 +25,20 @@ struct page_cgroup;
25struct page; 25struct page;
26struct mm_struct; 26struct mm_struct;
27 27
28#ifdef CONFIG_CGROUP_MEM_CONT 28#ifdef CONFIG_CGROUP_MEM_RES_CTLR
29 29
30extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p); 30extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
31extern void mm_free_cgroup(struct mm_struct *mm); 31extern void mm_free_cgroup(struct mm_struct *mm);
32extern void page_assign_page_cgroup(struct page *page, 32
33 struct page_cgroup *pc); 33#define page_reset_bad_cgroup(page) ((page)->page_cgroup = 0)
34
34extern struct page_cgroup *page_get_page_cgroup(struct page *page); 35extern struct page_cgroup *page_get_page_cgroup(struct page *page);
35extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm, 36extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
36 gfp_t gfp_mask); 37 gfp_t gfp_mask);
37extern void mem_cgroup_uncharge(struct page_cgroup *pc); 38extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
39 gfp_t gfp_mask);
38extern void mem_cgroup_uncharge_page(struct page *page); 40extern void mem_cgroup_uncharge_page(struct page *page);
39extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active); 41extern void mem_cgroup_move_lists(struct page *page, bool active);
40extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, 42extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
41 struct list_head *dst, 43 struct list_head *dst,
42 unsigned long *scanned, int order, 44 unsigned long *scanned, int order,
@@ -44,11 +46,9 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
44 struct mem_cgroup *mem_cont, 46 struct mem_cgroup *mem_cont,
45 int active); 47 int active);
46extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 48extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
47extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
48 gfp_t gfp_mask);
49int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 49int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
50 50
51#define vm_match_cgroup(mm, cgroup) \ 51#define mm_match_cgroup(mm, cgroup) \
52 ((cgroup) == rcu_dereference((mm)->mem_cgroup)) 52 ((cgroup) == rcu_dereference((mm)->mem_cgroup))
53 53
54extern int mem_cgroup_prepare_migration(struct page *page); 54extern int mem_cgroup_prepare_migration(struct page *page);
@@ -72,7 +72,7 @@ extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
72extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem, 72extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
73 struct zone *zone, int priority); 73 struct zone *zone, int priority);
74 74
75#else /* CONFIG_CGROUP_MEM_CONT */ 75#else /* CONFIG_CGROUP_MEM_RES_CTLR */
76static inline void mm_init_cgroup(struct mm_struct *mm, 76static inline void mm_init_cgroup(struct mm_struct *mm,
77 struct task_struct *p) 77 struct task_struct *p)
78{ 78{
@@ -82,8 +82,7 @@ static inline void mm_free_cgroup(struct mm_struct *mm)
82{ 82{
83} 83}
84 84
85static inline void page_assign_page_cgroup(struct page *page, 85static inline void page_reset_bad_cgroup(struct page *page)
86 struct page_cgroup *pc)
87{ 86{
88} 87}
89 88
@@ -92,33 +91,27 @@ static inline struct page_cgroup *page_get_page_cgroup(struct page *page)
92 return NULL; 91 return NULL;
93} 92}
94 93
95static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm, 94static inline int mem_cgroup_charge(struct page *page,
96 gfp_t gfp_mask) 95 struct mm_struct *mm, gfp_t gfp_mask)
97{ 96{
98 return 0; 97 return 0;
99} 98}
100 99
101static inline void mem_cgroup_uncharge(struct page_cgroup *pc) 100static inline int mem_cgroup_cache_charge(struct page *page,
101 struct mm_struct *mm, gfp_t gfp_mask)
102{ 102{
103 return 0;
103} 104}
104 105
105static inline void mem_cgroup_uncharge_page(struct page *page) 106static inline void mem_cgroup_uncharge_page(struct page *page)
106{ 107{
107} 108}
108 109
109static inline void mem_cgroup_move_lists(struct page_cgroup *pc, 110static inline void mem_cgroup_move_lists(struct page *page, bool active)
110 bool active)
111{
112}
113
114static inline int mem_cgroup_cache_charge(struct page *page,
115 struct mm_struct *mm,
116 gfp_t gfp_mask)
117{ 111{
118 return 0;
119} 112}
120 113
121static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 114static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
122{ 115{
123 return 1; 116 return 1;
124} 117}