]> www.infradead.org Git - users/dwmw2/linux.git/commit
mm: memcontrol: fix percpu vmstats and vmevents flush
authorShakeel Butt <shakeelb@google.com>
Fri, 30 Aug 2019 23:04:53 +0000 (16:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:23:48 +0000 (10:23 +0200)
commitb6a0d1f9bf08923bb53bbd4b72f0ff6ce2b2718a
tree32d2db4c3590ee8188e6b1bea8745cd953fadba2
parentbba5bcb0cc0ea3d493e5c4a9b72d8b77dff0fbd6
mm: memcontrol: fix percpu vmstats and vmevents flush

commit 6c1c280805ded72eceb2afc1a0d431b256608554 upstream.

Instead of using raw_cpu_read() use per_cpu() to read the actual data of
the corresponding cpu otherwise we will be reading the data of the
current cpu for the number of online CPUs.

Link: http://lkml.kernel.org/r/20190829203110.129263-1-shakeelb@google.com
Fixes: bb65f89b7d3d ("mm: memcontrol: flush percpu vmevents before releasing memcg")
Fixes: c350a99ea2b1 ("mm: memcontrol: flush percpu vmstats before releasing memcg")
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Roman Gushchin <guro@fb.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/memcontrol.c