From: Shakeel Butt <shakeel.butt@linux.dev>
To: Thomas Ballasi <tballasi@linux.microsoft.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] mm: vmscan: add cgroup IDs to vmscan tracepoints
Date: Tue, 16 Dec 2025 10:50:10 -0800 [thread overview]
Message-ID: <stm4ixcvtc6bwr75fos6w6anfaqfgjpe2mtt76zfrb2y63bat2@grvm7kzfz47n> (raw)
In-Reply-To: <20251216140252.11864-2-tballasi@linux.microsoft.com>
On Tue, Dec 16, 2025 at 06:02:51AM -0800, Thomas Ballasi wrote:
> Memory reclaim events are currently difficult to attribute to
> specific cgroups, making debugging memory pressure issues
> challenging. This patch adds memory cgroup ID (memcg_id) to key
> vmscan tracepoints to enable better correlation and analysis.
>
> For operations not associated with a specific cgroup, the field
> is defaulted to 0.
>
> Signed-off-by: Thomas Ballasi <tballasi@linux.microsoft.com>
> ---
...
> + __entry->memcg_id = sc->memcg ? mem_cgroup_id(sc->memcg) : 0;
...
> + __entry->memcg_id = sc->memcg ? mem_cgroup_id(sc->memcg) : 0;
...
>
...
> trace_mm_vmscan_memcg_softlimit_reclaim_begin(sc.order,
> - sc.gfp_mask);
> + sc.gfp_mask,
> + mem_cgroup_id(memcg));
>
...
> + trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed, mem_cgroup_id(memcg));
...
> + trace_mm_vmscan_memcg_reclaim_begin(0, sc.gfp_mask, mem_cgroup_id(memcg));
...
> + trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed, mem_cgroup_id(memcg));
Please don't use mem_cgroup_id() here as it is an ID internal to memcg.
Use cgroup_id(memcg->css.cgroup) instead which is inode number and is
exposed to the userspace.
next prev parent reply other threads:[~2025-12-16 18:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 18:14 [PATCH 0/2] mm: vmscan: add PID and cgroup ID " Thomas Ballasi
2025-12-08 18:14 ` [PATCH 1/2] mm: vmscan: add cgroup IDs " Thomas Ballasi
2025-12-08 18:14 ` [PATCH 2/2] mm: vmscan: add PIDs " Thomas Ballasi
2025-12-10 3:09 ` Steven Rostedt
2025-12-16 14:02 ` [PATCH v2 0/2] mm: vmscan: add PID and cgroup ID " Thomas Ballasi
2025-12-16 14:02 ` [PATCH v2 1/2] mm: vmscan: add cgroup IDs " Thomas Ballasi
2025-12-16 18:50 ` Shakeel Butt [this message]
2025-12-17 22:21 ` Steven Rostedt
2025-12-16 14:02 ` [PATCH v2 2/2] mm: vmscan: add PIDs " Thomas Ballasi
2025-12-16 18:03 ` Steven Rostedt
2025-12-29 10:54 ` Thomas Ballasi
2025-12-29 18:29 ` Steven Rostedt
2025-12-29 21:36 ` Steven Rostedt
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=stm4ixcvtc6bwr75fos6w6anfaqfgjpe2mtt76zfrb2y63bat2@grvm7kzfz47n \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tballasi@linux.microsoft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox