Commit 03583f1a631c0511dfd2f16e716d5b40f675de5a

Authored by Johannes Weiner
Committed by Linus Torvalds
1 parent 284f39afea

memcg: remove unnecessary !mm check from try_get_mem_cgroup_from_mm()

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>

Showing 1 changed file with 0 additions and 7 deletions Side-by-side Diff

... ... @@ -1075,13 +1075,6 @@
1075 1075 {
1076 1076 struct mem_cgroup *memcg = NULL;
1077 1077  
1078   - if (!mm)
1079   - return NULL;
1080   - /*
1081   - * Because we have no locks, mm->owner's may be being moved to other
1082   - * cgroup. We use css_tryget() here even if this looks
1083   - * pessimistic (rather than adding locks here).
1084   - */
1085 1078 rcu_read_lock();
1086 1079 do {
1087 1080 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));