Skip to content

Commit 03583f1

Browse files
hnaztorvalds
authored andcommitted
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 <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 284f39a commit 03583f1

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

mm/memcontrol.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,13 +1075,6 @@ struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
10751075
{
10761076
struct mem_cgroup *memcg = NULL;
10771077

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-
*/
10851078
rcu_read_lock();
10861079
do {
10871080
memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));

0 commit comments

Comments
 (0)