mm/memcg: set memcg after css verified and got reference
authorWei Yang <richard.weiyang@gmail.com>
Mon, 28 Feb 2022 23:00:05 +0000 (10:00 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:00:05 +0000 (10:00 +1100)
commiteb428f1f4fa6bccfa040331ba8d577927c3f0deb
tree98d5aadc175b1b937dd071c80328e2187606ac4e
parent86c3d1ca5af768379fbcb6c4897eca1a6cb3f94e
mm/memcg: set memcg after css verified and got reference

Patch series "mm/memcg: some cleanup for mem_cgroup_iter()".

This patch (of 3):

Instead of resetting memcg when css is either not verified or has no
reference, we can set it after these are processed.

No functional change, just simplified the code a little.

Link: https://lkml.kernel.org/r/20220225003437.12620-2-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/memcontrol.c