aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-04-13 03:50:21 -0400
committerIngo Molnar <mingo@kernel.org>2012-04-13 03:50:21 -0400
commit659c36fcda403013a01b85da07cf2d9711e6d6c7 (patch)
treeece2e7d0e2c19ea5a3d0ec172ad0b81a8a19021d /include/linux/memcontrol.h
parent9521d830b6341d1887dcfc2aebde23fbfa5f1473 (diff)
parent5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Fixes and improvements for perf/core: . Overhaul the tools/ makefiles, gluing them to the top level Makefile, from Borislav Petkov. . Move the UI files from tools/perf/util/ui/ to tools/perf/ui/. Also move the GTK+ browser to tools/perf/ui/gtk/, from Namhyung Kim. . Only fallback to sw cycles counter on ENOENT for the hw cycles, from Robert Richter . Trivial fixes from Robert Richter . Handle the autogenerated bison/flex files better, from Namhyung and Jiri Olsa. . Navigate jump instructions in the annotate browser, just press enter or ->, still needs support for a jump navigation history, i.e. to go back. . Search string in the annotate browser: same keys as vim: / forward n next backward/forward ? backward . Clarify number of events/samples in the report header, from Ashay Rane Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r--include/linux/memcontrol.h58
1 files changed, 41 insertions, 17 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index b80de520670b..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);
@@ -140,6 +141,34 @@ static inline bool mem_cgroup_disabled(void)
140 return false; 141 return false;
141} 142}
142 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
143void mem_cgroup_update_page_stat(struct page *page, 172void mem_cgroup_update_page_stat(struct page *page,
144 enum mem_cgroup_page_stat_item idx, 173 enum mem_cgroup_page_stat_item idx,
145 int val); 174 int val);
@@ -298,21 +327,6 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root,
298{ 327{
299} 328}
300 329
301static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg)
302{
303 return 0;
304}
305
306static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg,
307 int priority)
308{
309}
310
311static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg,
312 int priority)
313{
314}
315
316static inline bool mem_cgroup_disabled(void) 330static inline bool mem_cgroup_disabled(void)
317{ 331{
318 return true; 332 return true;
@@ -355,6 +369,16 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
355{ 369{
356} 370}
357 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
358static inline void mem_cgroup_inc_page_stat(struct page *page, 382static inline void mem_cgroup_inc_page_stat(struct page *page,
359 enum mem_cgroup_page_stat_item idx) 383 enum mem_cgroup_page_stat_item idx)
360{ 384{
@@ -391,7 +415,7 @@ static inline void mem_cgroup_replace_page_cache(struct page *oldpage,
391 struct page *newpage) 415 struct page *newpage)
392{ 416{
393} 417}
394#endif /* CONFIG_CGROUP_MEM_CONT */ 418#endif /* CONFIG_CGROUP_MEM_RES_CTLR */
395 419
396#if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM) 420#if !defined(CONFIG_CGROUP_MEM_RES_CTLR) || !defined(CONFIG_DEBUG_VM)
397static inline bool 421static inline bool