summary refs log tree commit diff
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorYafang Shao <laoar.shao@gmail.com>2019-07-16 16:26:06 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-16 19:23:21 -0700
commit766a4c19d880887c457811b86f1f68525e416965 (patch)
treed249e91205876cc0126f1765cd71de40958ddfd2 /mm/vmscan.c
parentf1549cb5ab2bd04cb370502b720268f610e21baa (diff)
downloadlinux-766a4c19d880887c457811b86f1f68525e416965.tar.gz
mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones
After commit 815744d75152 ("mm: memcontrol: don't batch updates of local
VM stats and events"), the local VM counter are not in sync with the
hierarchical ones.

Below is one example in a leaf memcg on my server (with 8 CPUs):

	inactive_file 3567570944
	total_inactive_file 3568029696

We find that the deviation is very great because the 'val' in
__mod_memcg_state() is in pages while the effective value in
memcg_stat_show() is in bytes.

So the maximum of this deviation between local VM stats and total VM
stats can be (32 * number_of_cpu * PAGE_SIZE), that may be an
unacceptably great value.

We should keep the local VM stats in sync with the total stats.  In
order to keep this behavior the same across counters, this patch updates
__mod_lruvec_state() and __count_memcg_events() as well.

Link: http://lkml.kernel.org/r/1562851979-10610-1-git-send-email-laoar.shao@gmail.com
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Yafang Shao <shaoyafang@didiglobal.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
0 files changed, 0 insertions, 0 deletions