diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2014-12-10 18:44:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 20:41:08 -0500 |
commit | 2314b42db67be30b747122d65c6cd2c85da34538 (patch) | |
tree | 5dffdf758736c83b6bfe8b6ada0dbb99d992c0f5 /include/linux/memcontrol.h | |
parent | 413918bb61b4fa027baa3e79546c47f15e4b9ea8 (diff) |
mm: memcontrol: drop bogus RCU locking from mem_cgroup_same_or_subtree()
None of the mem_cgroup_same_or_subtree() callers actually require it to
take the RCU lock, either because they hold it themselves or they have css
references. Remove it.
To make the API change clear, rename the leftover helper to
mem_cgroup_is_descendant() to match cgroup_is_descendant().
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r-- | include/linux/memcontrol.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e32ab948f589..d4575a1d6e99 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -68,10 +68,9 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage, | |||
68 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); | 68 | struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *); |
69 | struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); | 69 | struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *); |
70 | 70 | ||
71 | bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, | 71 | bool mem_cgroup_is_descendant(struct mem_cgroup *memcg, |
72 | struct mem_cgroup *memcg); | 72 | struct mem_cgroup *root); |
73 | bool task_in_mem_cgroup(struct task_struct *task, | 73 | bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg); |
74 | const struct mem_cgroup *memcg); | ||
75 | 74 | ||
76 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | 75 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); |
77 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 76 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
@@ -79,8 +78,8 @@ extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | |||
79 | extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); | 78 | extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); |
80 | extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css); | 79 | extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css); |
81 | 80 | ||
82 | static inline | 81 | static inline bool mm_match_cgroup(struct mm_struct *mm, |
83 | bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg) | 82 | struct mem_cgroup *memcg) |
84 | { | 83 | { |
85 | struct mem_cgroup *task_memcg; | 84 | struct mem_cgroup *task_memcg; |
86 | bool match = false; | 85 | bool match = false; |
@@ -88,7 +87,7 @@ bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg) | |||
88 | rcu_read_lock(); | 87 | rcu_read_lock(); |
89 | task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); | 88 | task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); |
90 | if (task_memcg) | 89 | if (task_memcg) |
91 | match = __mem_cgroup_same_or_subtree(memcg, task_memcg); | 90 | match = mem_cgroup_is_descendant(task_memcg, memcg); |
92 | rcu_read_unlock(); | 91 | rcu_read_unlock(); |
93 | return match; | 92 | return match; |
94 | } | 93 | } |