All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Gushchin <roman.gushchin@linux.dev>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Muchun Song <muchun.song@linux.dev>,
	"T . J . Mercier" <tjmercier@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Meta kernel team <kernel-team@meta.com>,
	cgroups@vger.kernel.org
Subject: Re: [PATCH 1/7] memcg: move v1 only percpu stats in separate struct
Date: Thu, 15 Aug 2024 19:34:32 +0000	[thread overview]
Message-ID: <Zr5YSLdtHdFZoQQI@google.com> (raw)
In-Reply-To: <20240815050453.1298138-2-shakeel.butt@linux.dev>

On Wed, Aug 14, 2024 at 10:04:47PM -0700, Shakeel Butt wrote:
> At the moment struct memcg_vmstats_percpu contains two v1 only fields
> which consumes memory even when CONFIG_MEMCG_V1 is not enabled. In
> addition there are v1 only functions accessing them and are in the main
> memcontrol source file and can not be moved to v1 only source file due
> to these fields. Let's move these fields into their own struct. Later
> patches will move the functions accessing them to v1 source file and
> only allocate these fields when CONFIG_MEMCG_V1 is enabled.
> 
> Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
> ---
>  include/linux/memcontrol.h |  2 ++
>  mm/memcontrol-v1.h         | 19 +++++++++++++++++++
>  mm/memcontrol.c            | 18 +++++++++---------
>  3 files changed, 30 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
> index 90ecd2dbca06..e21a1541adeb 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -70,6 +70,7 @@ struct mem_cgroup_id {
>  };
>  
>  struct memcg_vmstats_percpu;
> +struct memcg1_events_percpu;
>  struct memcg_vmstats;
>  struct lruvec_stats_percpu;
>  struct lruvec_stats;
> @@ -254,6 +255,7 @@ struct mem_cgroup {
>  	struct list_head objcg_list;
>  
>  	struct memcg_vmstats_percpu __percpu *vmstats_percpu;
> +	struct memcg1_events_percpu __percpu *events_percpu;

It wasn't really obvious until the patch [6/7] why it's not
under CONFIG_MEMCG_V1, but otherwise the series looks great to me.

Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
for the whole series.

Thank you!

  reply	other threads:[~2024-08-15 19:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15  5:04 [PATCH 0/7] memcg: further decouple v1 code from v2 Shakeel Butt
2024-08-15  5:04 ` [PATCH 1/7] memcg: move v1 only percpu stats in separate struct Shakeel Butt
2024-08-15 19:34   ` Roman Gushchin [this message]
2024-08-15  5:04 ` [PATCH 2/7] memcg: move mem_cgroup_event_ratelimit to v1 code Shakeel Butt
2024-08-15  5:04 ` [PATCH 3/7] memcg: move mem_cgroup_charge_statistics " Shakeel Butt
2024-08-15  5:04 ` [PATCH 4/7] memcg: move v1 events and statistics code to v1 file Shakeel Butt
2024-08-15  5:04 ` [PATCH 5/7] memcg: make v1 only functions static Shakeel Butt
2024-08-15  5:04 ` [PATCH 6/7] memcg: allocate v1 event percpu only on v1 deployment Shakeel Butt
2024-08-15  5:04 ` [PATCH 7/7] memcg: make PGPGIN and PGPGOUT v1 only 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=Zr5YSLdtHdFZoQQI@google.com \
    --to=roman.gushchin@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=tjmercier@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.