linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/8] memcg: reduce memory consumption by memcg stats
@ 2024-04-30  6:06 Shakeel Butt
  2024-04-30  6:06 ` [PATCH v3 1/8] memcg: reduce memory size of mem_cgroup_events_index Shakeel Butt
                   ` (7 more replies)
  0 siblings, 8 replies; 26+ messages in thread
From: Shakeel Butt @ 2024-04-30  6:06 UTC (permalink / raw)
  To: Andrew Morton, Johannes Weiner, Michal Hocko, Roman Gushchin,
	Muchun Song, Yosry Ahmed, T . J . Mercier
  Cc: kernel-team, linux-mm, linux-kernel

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 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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2024-05-01  0:51 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30  6:06 [PATCH v3 0/8] memcg: reduce memory consumption by memcg stats Shakeel Butt
2024-04-30  6:06 ` [PATCH v3 1/8] memcg: reduce memory size of mem_cgroup_events_index Shakeel Butt
2024-04-30  8:33   ` Yosry Ahmed
2024-04-30 17:29     ` T.J. Mercier
2024-04-30  6:06 ` [PATCH v3 2/8] memcg: dynamically allocate lruvec_stats Shakeel Butt
2024-04-30 17:29   ` T.J. Mercier
2024-04-30  6:06 ` [PATCH v3 3/8] mm: memcg: account memory used for memcg vmstats and lruvec stats Shakeel Butt
2024-04-30  8:34   ` Yosry Ahmed
2024-04-30 17:30     ` T.J. Mercier
2024-04-30  6:06 ` [PATCH v3 4/8] memcg: reduce memory for the lruvec and memcg stats Shakeel Butt
2024-04-30  8:41   ` Yosry Ahmed
2024-04-30 17:37     ` Shakeel Butt
2024-04-30 17:41       ` Yosry Ahmed
2024-04-30 17:49         ` Shakeel Butt
2024-04-30 23:00         ` Shakeel Butt
2024-04-30 23:07           ` Yosry Ahmed
2024-05-01  0:50             ` Johannes Weiner
2024-04-30 17:30   ` T.J. Mercier
2024-04-30 17:45     ` Shakeel Butt
2024-04-30  6:06 ` [PATCH v3 5/8] memcg: cleanup __mod_memcg_lruvec_state Shakeel Butt
2024-04-30 17:31   ` T.J. Mercier
2024-04-30  6:06 ` [PATCH v3 6/8] mm: cleanup WORKINGSET_NODES in workingset Shakeel Butt
2024-04-30 17:32   ` T.J. Mercier
2024-04-30  6:06 ` [PATCH v3 7/8] memcg: warn for unexpected events and stats Shakeel Butt
2024-04-30  6:06 ` [PATCH v3 8/8] memcg: use proper type for mod_memcg_state Shakeel Butt
2024-04-30 18:09   ` T.J. Mercier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).