Skip to content

memcg: reduce memory consumption by memcg stats

Shakeel Butt linux-mm lkml 4 versions – Applied

Status from this message: [merged mm-stable] memcg-use-proper-type-for-mod_memcg_state.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 4 repliesApplied 8/8
  2. v38 patches 17 repliesSuperseded
  3. v27 patches 25 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches5 repliesSuperseded

Changes in v4 from the cover letter

Minor changes related to changing macro names and chaning the if conditions orders.

Patches in v4 All 8 applied

#Subject and filesSizeRepliesApplied
1/8memcg: reduce memory size of mem_cgroup_events_indexmm/memcontrol.c+4 -20 repliesApplied
2/8memcg: dynamically allocate lruvec_statsinclude/linux/memcontrol.h mm/memcontrol.c+81 -681 replyApplied
3/8mm: memcg: account memory used for memcg vmstats and lruvec statsmm/memcontrol.c+4 -30 repliesApplied
4/8memcg: reduce memory for the lruvec and memcg statsmm/memcontrol.c+114 -201 replyApplied
5/8memcg: cleanup __mod_memcg_lruvec_statemm/memcontrol.c+0 -20 repliesApplied
6/8mm: cleanup WORKINGSET_NODES in workingsetmm/workingset.c+4 -30 repliesApplied
7/8memcg: warn for unexpected events and statsmm/memcontrol.c+23 -161 replyApplied
8/8memcg: use proper type for mod_memcg_stateinclude/linux/memcontrol.h mm/memcontrol.c+9 -71 replyApplied

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchRoman GushchinYosry AhmedT.J. Mercier
1/8R-b R-b R-b
2/8R-b R-b R-b
3/8R-b R-b
4/8R-b
5/8R-b R-b R-b
6/8R-b R-b
7/8R-b
8/8R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/8] memcg: reduce memory consumption by memcg stats

Most of the memory overhead of a memcg object is due to memcg stats maintained by the kernel. Since stats updates happen in performance critical codepaths, the stats are maintained per-cpu and numa specific stats are maintained per-node * per-cpu. This drastically increase the overhead on large machines i.e. large of CPUs and multiple numa nodes. This patch series tries to reduce the overhead by at least not allocating the memory for stats which are not memcg specific.

Changelog since v3:
Minor changes related to changing macro names and chaning the if conditions orders.

Changelog since v2:
Using WARN_ONCE() instead of pr_warn_once() and some changes commit log changes. Also included a patch from Roman.

Changelog since v1:
The main change from the v1 is the indirection approach used in this patchset instead of rearranging the members of node_stat_item.

Roman Gushchin (1):
mm: memcg: account memory used for memcg vmstats and lruvec stats

Shakeel Butt (7):
memcg: reduce memory size of mem_cgroup_events_index
memcg: dynamically allocate lruvec_stats
memcg: reduce memory for the lruvec and memcg stats
memcg: cleanup __mod_memcg_lruvec_state
mm: cleanup WORKINGSET_NODES in workingset
memcg: warn for unexpected events and stats
memcg: use proper type for mod_memcg_state

 include/linux/memcontrol.h |  75 ++----------
 mm/memcontrol.c            | 244 +++++++++++++++++++++++++++++++------
 mm/workingset.c            |   7 +-
 3 files changed, 222 insertions(+), 104 deletions(-)
Signature · 1 line
2.43.0