diff options
-rw-r--r-- | include/linux/memcontrol.h | 11 | ||||
-rw-r--r-- | mm/memcontrol.c | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index cc0ad7191acd..4f580268b1b7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -20,6 +20,9 @@ | |||
20 | #ifndef _LINUX_MEMCONTROL_H | 20 | #ifndef _LINUX_MEMCONTROL_H |
21 | #define _LINUX_MEMCONTROL_H | 21 | #define _LINUX_MEMCONTROL_H |
22 | 22 | ||
23 | #include <linux/rcupdate.h> | ||
24 | #include <linux/mm.h> | ||
25 | |||
23 | struct mem_cgroup; | 26 | struct mem_cgroup; |
24 | struct page_cgroup; | 27 | struct page_cgroup; |
25 | struct page; | 28 | struct page; |
@@ -45,7 +48,11 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
45 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 48 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
46 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, | 49 | extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm, |
47 | gfp_t gfp_mask); | 50 | gfp_t gfp_mask); |
48 | extern struct mem_cgroup *mm_cgroup(struct mm_struct *mm); | 51 | |
52 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) | ||
53 | { | ||
54 | return rcu_dereference(mm->mem_cgroup); | ||
55 | } | ||
49 | 56 | ||
50 | static inline void mem_cgroup_uncharge_page(struct page *page) | 57 | static inline void mem_cgroup_uncharge_page(struct page *page) |
51 | { | 58 | { |
@@ -98,7 +105,7 @@ static inline int mem_cgroup_cache_charge(struct page *page, | |||
98 | return 0; | 105 | return 0; |
99 | } | 106 | } |
100 | 107 | ||
101 | static inline struct mem_cgroup *mm_cgroup(struct mm_struct *mm) | 108 | static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm) |
102 | { | 109 | { |
103 | return NULL; | 110 | return NULL; |
104 | } | 111 | } |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ac8774426fec..f6cdbf755ed3 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -110,11 +110,6 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) | |||
110 | struct mem_cgroup, css); | 110 | struct mem_cgroup, css); |
111 | } | 111 | } |
112 | 112 | ||
113 | inline struct mem_cgroup *mm_cgroup(struct mm_struct *mm) | ||
114 | { | ||
115 | return rcu_dereference(mm->mem_cgroup); | ||
116 | } | ||
117 | |||
118 | void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p) | 113 | void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p) |
119 | { | 114 | { |
120 | struct mem_cgroup *mem; | 115 | struct mem_cgroup *mem; |