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.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index c54e5dfa1962..bf7ae01fc93b 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -141,6 +141,31 @@ 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
147static inline void mem_cgroup_begin_update_page_stat(struct page *page,
148 bool *locked, unsigned long *flags)
149{
150 if (mem_cgroup_disabled())
151 return;
152 rcu_read_lock();
153 *locked = false;
154 return __mem_cgroup_begin_update_page_stat(page, locked, flags);
155}
156
157void __mem_cgroup_end_update_page_stat(struct page *page,
158 unsigned long *flags);
159static inline void mem_cgroup_end_update_page_stat(struct page *page,
160 bool *locked, unsigned long *flags)
161{
162 if (mem_cgroup_disabled())
163 return;
164 if (*locked)
165 __mem_cgroup_end_update_page_stat(page, flags);
166 rcu_read_unlock();
167}
168
144void mem_cgroup_update_page_stat(struct page *page, 169void mem_cgroup_update_page_stat(struct page *page,
145 enum mem_cgroup_page_stat_item idx, 170 enum mem_cgroup_page_stat_item idx,
146 int val); 171 int val);
@@ -341,6 +366,16 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
341{ 366{
342} 367}
343 368
369static inline void mem_cgroup_begin_update_page_stat(struct page *page,
370 bool *locked, unsigned long *flags)
371{
372}
373
374static inline void mem_cgroup_end_update_page_stat(struct page *page,
375 bool *locked, unsigned long *flags)
376{
377}
378
344static inline void mem_cgroup_inc_page_stat(struct page *page, 379static inline void mem_cgroup_inc_page_stat(struct page *page,
345 enum mem_cgroup_page_stat_item idx) 380 enum mem_cgroup_page_stat_item idx)
346{ 381{