linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeel.butt@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Muchun Song <muchun.song@linux.dev>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] memcg: reduce memory consumption by memcg stats
Date: Mon, 22 Apr 2024 22:18:22 -0700	[thread overview]
Message-ID: <20240423051826.791934-1-shakeel.butt@linux.dev> (raw)

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.

Shakeel Butt (4):
  mm: rearrange node_stat_item to put memcg stats at start
  memcg: reduce memory for the lruvec and memcg stats
  memcg: use proper type for mod_memcg_state
  memcg: restrict __mod_memcg_lruvec_state to memcg stats

 include/linux/memcontrol.h | 25 +++++++++++++------------
 include/linux/mmzone.h     | 29 +++++++++++++++++------------
 mm/memcontrol.c            | 12 +++++++-----
 mm/vmstat.c                | 24 ++++++++++++------------
 4 files changed, 49 insertions(+), 41 deletions(-)

-- 
2.43.0



             reply	other threads:[~2024-04-23  5:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  5:18 Shakeel Butt [this message]
2024-04-23  5:18 ` [PATCH 1/4] mm: rearrange node_stat_item to put memcg stats at start Shakeel Butt
2024-04-23 13:58   ` Johannes Weiner
2024-04-23 17:44     ` Shakeel Butt
2024-04-23 18:30       ` Johannes Weiner
2024-04-25 22:54         ` Chris Li
2024-04-25 18:01   ` Chris Li
2024-04-23  5:18 ` [PATCH 2/4] memcg: reduce memory for the lruvec and memcg stats Shakeel Butt
2024-04-23 14:40   ` kernel test robot
2024-04-23 20:58   ` kernel test robot
2024-04-23  5:22 ` [PATCH 3/4] memcg: use proper type for mod_memcg_state Shakeel Butt
2024-04-23  5:23 ` [PATCH 4/4] memcg: restrict __mod_memcg_lruvec_state to memcg stats Shakeel Butt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240423051826.791934-1-shakeel.butt@linux.dev \
    --to=shakeel.butt@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox