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.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index ac797fa03ef8..05206aac5965 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -78,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void);
78extern void mem_cgroup_uncharge_page(struct page *page); 78extern void mem_cgroup_uncharge_page(struct page *page);
79extern void mem_cgroup_uncharge_cache_page(struct page *page); 79extern void mem_cgroup_uncharge_cache_page(struct page *page);
80 80
81extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 81extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask);
82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
83 83
84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
85extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 85extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
@@ -88,19 +88,19 @@ extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
88static inline 88static inline
89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
90{ 90{
91 struct mem_cgroup *mem; 91 struct mem_cgroup *memcg;
92 rcu_read_lock(); 92 rcu_read_lock();
93 mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); 93 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner));
94 rcu_read_unlock(); 94 rcu_read_unlock();
95 return cgroup == mem; 95 return cgroup == memcg;
96} 96}
97 97
98extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); 98extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg);
99 99
100extern int 100extern int
101mem_cgroup_prepare_migration(struct page *page, 101mem_cgroup_prepare_migration(struct page *page,
102 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); 102 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask);
103extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 103extern void mem_cgroup_end_migration(struct mem_cgroup *memcg,
104 struct page *oldpage, struct page *newpage, bool migration_ok); 104 struct page *oldpage, struct page *newpage, bool migration_ok);
105 105
106/* 106/*
@@ -148,7 +148,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
148unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 148unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
149 gfp_t gfp_mask, 149 gfp_t gfp_mask,
150 unsigned long *total_scanned); 150 unsigned long *total_scanned);
151u64 mem_cgroup_get_limit(struct mem_cgroup *mem); 151u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
152 152
153void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 153void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
154#ifdef CONFIG_TRANSPARENT_HUGEPAGE 154#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -244,18 +244,20 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm
244 return NULL; 244 return NULL;
245} 245}
246 246
247static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 247static inline int mm_match_cgroup(struct mm_struct *mm,
248 struct mem_cgroup *memcg)
248{ 249{
249 return 1; 250 return 1;
250} 251}
251 252
252static inline int task_in_mem_cgroup(struct task_struct *task, 253static inline int task_in_mem_cgroup(struct task_struct *task,
253 const struct mem_cgroup *mem) 254 const struct mem_cgroup *memcg)
254{ 255{
255 return 1; 256 return 1;
256} 257}
257 258
258static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) 259static inline struct cgroup_subsys_state
260 *mem_cgroup_css(struct mem_cgroup *memcg)
259{ 261{
260 return NULL; 262 return NULL;
261} 263}
@@ -267,22 +269,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
267 return 0; 269 return 0;
268} 270}
269 271
270static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, 272static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
271 struct page *oldpage, struct page *newpage, bool migration_ok) 273 struct page *oldpage, struct page *newpage, bool migration_ok)
272{ 274{
273} 275}
274 276
275static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) 277static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg)
276{ 278{
277 return 0; 279 return 0;
278} 280}
279 281
280static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, 282static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg,
281 int priority) 283 int priority)
282{ 284{
283} 285}
284 286
285static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, 287static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg,
286 int priority) 288 int priority)
287{ 289{
288} 290}
@@ -348,7 +350,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
348} 350}
349 351
350static inline 352static inline
351u64 mem_cgroup_get_limit(struct mem_cgroup *mem) 353u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
352{ 354{
353 return 0; 355 return 0;
354} 356}