Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: memcontrol: drop superfluous entry in the per-memcg stats array

MEM_CGROUP_STAT_NSTATS is just a delimiter for cgroup1 statistics, not
an actual array entry. Reuse it for the first cgroup2 stat entry, like
in the event array.

Fixes: b2807f07f4f8 ("mm: memcontrol: add "sock" to cgroup2 memory.stat")
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Johannes Weiner and committed by
Linus Torvalds
c792e824 461c7fa1

+1 -1
+1 -1
include/linux/memcontrol.h
··· 51 51 MEM_CGROUP_STAT_SWAP, /* # of pages, swapped out */ 52 52 MEM_CGROUP_STAT_NSTATS, 53 53 /* default hierarchy stats */ 54 - MEMCG_SOCK, 54 + MEMCG_SOCK = MEM_CGROUP_STAT_NSTATS, 55 55 MEMCG_NR_STAT, 56 56 }; 57 57