diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 34 |
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); | |||
78 | extern void mem_cgroup_uncharge_page(struct page *page); | 78 | extern void mem_cgroup_uncharge_page(struct page *page); |
79 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 79 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
80 | 80 | ||
81 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 81 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask); |
82 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 82 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); |
83 | 83 | ||
84 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 84 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
85 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 85 | extern 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); | |||
88 | static inline | 88 | static inline |
89 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | 89 | int 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 | ||
98 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); | 98 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg); |
99 | 99 | ||
100 | extern int | 100 | extern int |
101 | mem_cgroup_prepare_migration(struct page *page, | 101 | mem_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); |
103 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 103 | extern 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, | |||
148 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 148 | unsigned 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); |
151 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | 151 | u64 mem_cgroup_get_limit(struct mem_cgroup *memcg); |
152 | 152 | ||
153 | void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); | 153 | void 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 | ||
247 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 247 | static 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 | ||
252 | static inline int task_in_mem_cgroup(struct task_struct *task, | 253 | static 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 | ||
258 | static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) | 259 | static 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 | ||
270 | static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, | 272 | static 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 | ||
275 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) | 277 | static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg) |
276 | { | 278 | { |
277 | return 0; | 279 | return 0; |
278 | } | 280 | } |
279 | 281 | ||
280 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | 282 | static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg, |
281 | int priority) | 283 | int priority) |
282 | { | 284 | { |
283 | } | 285 | } |
284 | 286 | ||
285 | static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 287 | static 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 | ||
350 | static inline | 352 | static inline |
351 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | 353 | u64 mem_cgroup_get_limit(struct mem_cgroup *memcg) |
352 | { | 354 | { |
353 | return 0; | 355 | return 0; |
354 | } | 356 | } |