diff options
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 472efd09118..2de6504e01f 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -61,8 +61,15 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | |||
61 | 61 | ||
62 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 62 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
63 | 63 | ||
64 | #define mm_match_cgroup(mm, cgroup) \ | 64 | static inline |
65 | ((cgroup) == mem_cgroup_from_task((mm)->owner)) | 65 | int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) |
66 | { | ||
67 | struct mem_cgroup *mem; | ||
68 | rcu_read_lock(); | ||
69 | mem = mem_cgroup_from_task((mm)->owner); | ||
70 | rcu_read_unlock(); | ||
71 | return cgroup == mem; | ||
72 | } | ||
66 | 73 | ||
67 | extern int | 74 | extern int |
68 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); | 75 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); |