[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zr5YSLdtHdFZoQQI@google.com>
Date: Thu, 15 Aug 2024 19:34:32 +0000
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Muchun Song <muchun.song@...ux.dev>,
"T . J . Mercier" <tjmercier@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Meta kernel team <kernel-team@...a.com>, cgroups@...r.kernel.org
Subject: Re: [PATCH 1/7] memcg: move v1 only percpu stats in separate struct
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@...ux.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@...ux.dev>
for the whole series.
Thank you!
Powered by blists - more mailing lists