[Devel,rh7,03/21] ms/memcg: remove unnecessary !mm check from try_get_mem_cgroup_from_mm()

Submitted by Andrey Ryabinin on Nov. 1, 2016, 9:21 a.m.


Message ID 1477992100-18263-3-git-send-email-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Nov. 1, 2016, 9:21 a.m.
From: Johannes Weiner <hannes@cmpxchg.org>

Users pass either a mm that has been established under task lock, or use
a verified current->mm, which means the task can't be exiting.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
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>

(cherry picked from commit 03583f1a631c0511dfd2f16e716d5b40f675de5a)
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 mm/memcontrol.c | 7 -------
 1 file changed, 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 598abfa..ca3f8a8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1153,13 +1153,6 @@  struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
 	struct mem_cgroup *memcg = NULL;
-	if (!mm)
-		return NULL;
-	/*
-	 * Because we have no locks, mm->owner's may be being moved to other
-	 * cgroup. We use css_tryget() here even if this looks
-	 * pessimistic (rather than adding locks here).
-	 */
 	do {
 		memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));