mm: memcontrol: account kernel stack per node

Currently the kernel stack is being accounted per-zone.  There is no need
to do that.  In addition due to being per-zone, memcg has to keep a
separate MEMCG_KERNEL_STACK_KB.  Make the stat per-node and deprecate
MEMCG_KERNEL_STACK_KB as memcg_stat_item is an extension of
node_stat_item.  In addition localize the kernel stack stats updates to

Signed-off-by: Shakeel Butt <>
Signed-off-by: Andrew Morton <>
Reviewed-by: Roman Gushchin <>
Cc: Johannes Weiner <>
Cc: Michal Hocko <>
Signed-off-by: Linus Torvalds <>
9 files changed