mm/memcg: move generation assignment and comparison together
authorWei Yang <richard.weiyang@gmail.com>
Mon, 28 Feb 2022 23:00:07 +0000 (10:00 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:00:07 +0000 (10:00 +1100)
commitb6278a59b023b21dd03496974d6c9040a41020df
tree575f7e1fb20b13b878fcf10ab1b4ddf676d8c16d
parent3a316c1251e6cac2908d2007558524ec36bc2422
mm/memcg: move generation assignment and comparison together

For each round-trip, we assign generation on first invocation and compare
it on subsequent invocations.

Let's move them together to make it more self-explaining.  Also this
reduces a check on prev.

Link: https://lkml.kernel.org/r/20220225003437.12620-4-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
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