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.h63
1 files changed, 41 insertions, 22 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 4d34356fe644..f94efd2f6c27 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -77,7 +77,8 @@ extern void mem_cgroup_uncharge_end(void);
77extern void mem_cgroup_uncharge_page(struct page *page); 77extern void mem_cgroup_uncharge_page(struct page *page);
78extern void mem_cgroup_uncharge_cache_page(struct page *page); 78extern void mem_cgroup_uncharge_cache_page(struct page *page);
79 79
80extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask); 80extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
81 int order);
81int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); 82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
82 83
83extern 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);
@@ -129,7 +130,6 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
129extern void mem_cgroup_replace_page_cache(struct page *oldpage, 130extern void mem_cgroup_replace_page_cache(struct page *oldpage,
130 struct page *newpage); 131 struct page *newpage);
131 132
132extern void mem_cgroup_reset_owner(struct page *page);
133#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 133#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
134extern int do_swap_account; 134extern int do_swap_account;
135#endif 135#endif
@@ -141,6 +141,34 @@ static inline bool mem_cgroup_disabled(void)
141 return false; 141 return false;
142} 142}
143 143
144void __mem_cgroup_begin_update_page_stat(struct page *page, bool *locked,
145 unsigned long *flags);
146
147extern atomic_t memcg_moving;
148
149static inline void mem_cgroup_begin_update_page_stat(struct page *page,
150 bool *locked, unsigned long *flags)
151{
152 if (mem_cgroup_disabled())
153 return;
154 rcu_read_lock();
155 *locked = false;
156 if (atomic_read(&memcg_moving))
157 __mem_cgroup_begin_update_page_stat(page, locked, flags);
158}
159
160void __mem_cgroup_end_update_page_stat(struct page *page,
161 unsigned long *flags);
162static inline void mem_cgroup_end_update_page_stat(struct page *page,
163 bool *locked, unsigned long *flags)
164{
165 if (mem_cgroup_disabled())
166 return;
167 if (*locked)
168 __mem_cgroup_end_update_page_stat(page, flags);
169 rcu_read_unlock();
170}
171
144void mem_cgroup_update_page_stat(struct page *page, 172void mem_cgroup_update_page_stat(struct page *page,
145 enum mem_cgroup_page_stat_item idx, 173 enum mem_cgroup_page_stat_item idx,
146 int val); 174 int val);
@@ -299,21 +327,6 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root,
299{ 327{
300} 328}
301 329
302static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg)
303{
304 return 0;
305}
306
307static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg,
308 int priority)
309{
310}
311
312static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg,
313 int priority)
314{
315}
316
317static inline bool mem_cgroup_disabled(void) 330static inline bool mem_cgroup_disabled(void)
318{ 331{
319 return true; 332 return true;
@@ -356,6 +369,16 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
356{ 369{
357} 370}
358 371
372static inline void mem_cgroup_begin_update_page_stat(struct page *page,
373 bool *locked, unsigned long *flags)
374{
375}
376
377static inline void mem_cgroup_end_update_page_stat(struct page *page,
378 bool *locked, unsigned long *flags)
379{
380}
381
359static inline void mem_cgroup_inc_page_stat(struct page *page, 382static inline void mem_cgroup_inc_page_stat(struct page *page,
360 enum mem_cgroup_page_stat_item idx) 383 enum mem_cgroup_page_stat_item idx)
361{ 384{
@@ -392,11 +415,7 @@ static inline void mem_cgroup_replace_page_cache(struct page *oldpage,
392 struct page *newpage) 415 struct page *newpage)
393{ 416{
394} 417}
395 418#endif /* CONFIG_CGROUP_MEM_RES_CTLR */
396static inline void mem_cgroup_reset_owner(struct page *page)
397{
398}
399#endif /* CONFIG_CGROUP_MEM_CONT */
400 419
401#if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) 420#if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM)
402static inline bool 421static inline bool