From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Thomas Ballasi <tballasi@linux.microsoft.com>
Cc: akpm@linux-foundation.org, axelrasmussen@google.com,
david@kernel.org, hannes@cmpxchg.org, linux-mm@kvack.org,
linux-trace-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com,
mhiramat@kernel.org, mhocko@kernel.org, rostedt@goodmis.org,
shakeel.butt@linux.dev, weixugc@google.com, yuanchu@google.com,
zhengqi.arch@bytedance.com
Subject: Re: [PATCH v7 3/3] mm: vmscan: add PIDs to vmscan tracepoints
Date: Tue, 24 Feb 2026 08:30:14 +0900 [thread overview]
Message-ID: <20260224083014.66bf222ffd81a3ebaa57a0e0@kernel.org> (raw)
In-Reply-To: <20260223171544.4750-4-tballasi@linux.microsoft.com>
Hi,
On Mon, 23 Feb 2026 09:15:44 -0800
Thomas Ballasi <tballasi@linux.microsoft.com> wrote:
> The changes aims at adding additionnal tracepoints variables to help
> debuggers attribute them to specific processes.
>
> The PID field uses in_task() to reliably detect when we're in process
> context and can safely access current->pid. When not in process
> context (such as in interrupt or in an asynchronous RCU context), the
> field is set to -1 as a sentinel value.
>
> Signed-off-by: Thomas Ballasi <tballasi@linux.microsoft.com>
> ---
> include/trace/events/vmscan.h | 34 +++++++++++++++++++++++++---------
> 1 file changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
> index 1212f6a7c223e..15b31281f0955 100644
> --- a/include/trace/events/vmscan.h
> +++ b/include/trace/events/vmscan.h
> @@ -122,18 +122,22 @@ DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template,
> __field( unsigned long, gfp_flags )
> __field( u64, memcg_id )
> __field( int, order )
> + __field( int, pid )
> ),
>
> TP_fast_assign(
> __entry->gfp_flags = (__force unsigned long)gfp_flags;
> __entry->order = order;
> + __entry->pid = current->pid;
All entries saves current->pid in common_pid field. Can you use
this common field?
# cat events/vmscan/mm_vmscan_reclaim_pages/format
name: mm_vmscan_reclaim_pages
ID: 590
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1; ## <------------here
field:int nid; offset:8; size:4; signed:1;
field:unsigned long nr_scanned; offset:16; size:8; signed:0;
field:unsigned long nr_reclaimed; offset:24; size:8; signed:0;
field:unsigned long nr_dirty; offset:32; size:8; signed:0;
field:unsigned long nr_writeback; offset:40; size:8; signed:0;
field:unsigned long nr_congested; offset:48; size:8; signed:0;
field:unsigned long nr_immediate; offset:56; size:8; signed:0;
field:unsigned int nr_activate0; offset:64; size:4; signed:0;
field:unsigned int nr_activate1; offset:68; size:4; signed:0;
field:unsigned long nr_ref_keep; offset:72; size:8; signed:0;
field:unsigned long nr_unmap_fail; offset:80; size:8; signed:0;
Thank you,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
prev parent reply other threads:[~2026-02-23 23:30 UTC|newest]
Thread overview: 49+ 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
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
2026-01-05 16:04 ` [PATCH v3 0/2] mm: vmscan: add PID and cgroup ID " Thomas Ballasi
2026-01-05 16:04 ` [PATCH v3 1/2] mm: vmscan: add cgroup IDs " Thomas Ballasi
2026-01-05 22:46 ` Shakeel Butt
2026-01-07 18:14 ` Shakeel Butt
2026-01-07 18:32 ` Andrew Morton
2026-01-07 20:35 ` Shakeel Butt
2026-01-07 1:56 ` build error on CONFIG_MEMCG=n "error: invalid use of undefined type 'struct mem_cgroup'" Harry Yoo
2026-01-07 2:17 ` Andrew Morton
2026-01-05 16:04 ` [PATCH v3 2/2] mm: vmscan: add PIDs to vmscan tracepoints Thomas Ballasi
2026-01-06 2:06 ` [PATCH v3 0/2] mm: vmscan: add PID and cgroup ID " Andrew Morton
2026-01-06 2:21 ` Steven Rostedt
2026-01-15 12:38 ` [PATCH v4 0/3] " Thomas Ballasi
2026-01-15 12:38 ` [PATCH v4 1/3] tracing: Add __event_in_*irq() helpers Thomas Ballasi
2026-01-15 12:38 ` [PATCH v4 2/3] mm: vmscan: add cgroup IDs to vmscan tracepoints Thomas Ballasi
2026-01-15 12:38 ` [PATCH v4 3/3] mm: vmscan: add PIDs " Thomas Ballasi
2026-01-22 18:25 ` [PATCH v5 0/3] mm: vmscan: add PID and cgroup ID " Thomas Ballasi
2026-01-22 18:25 ` [PATCH v5 1/3] tracing: Add __event_in_*irq() helpers Thomas Ballasi
2026-01-22 18:25 ` [PATCH v5 2/3] mm: vmscan: add cgroup IDs to vmscan tracepoints Thomas Ballasi
2026-01-27 23:43 ` Shakeel Butt
2026-01-22 18:25 ` [PATCH v5 3/3] mm: vmscan: add PIDs " Thomas Ballasi
2026-01-22 18:52 ` [PATCH v5 0/3] mm: vmscan: add PID and cgroup ID " Andrew Morton
2026-02-13 18:15 ` [PATCH v6 " Thomas Ballasi
2026-02-13 18:15 ` [PATCH v6 1/3] tracing: Add __event_in_*irq() helpers Thomas Ballasi
2026-02-16 16:13 ` Usama Arif
2026-02-17 0:54 ` Steven Rostedt
2026-02-13 18:15 ` [PATCH v6 2/3] mm: vmscan: add cgroup IDs to vmscan tracepoints Thomas Ballasi
2026-02-13 18:15 ` [PATCH v6 3/3] mm: vmscan: add PIDs " Thomas Ballasi
2026-02-16 16:02 ` Usama Arif
2026-02-23 17:15 ` [PATCH v7 0/3] mm: vmscan: add PID and cgroup ID " Thomas Ballasi
2026-02-23 17:15 ` [PATCH v7 1/3] tracing: Add __event_in_*irq() helpers Thomas Ballasi
2026-02-23 19:33 ` Shakeel Butt
2026-02-23 17:15 ` [PATCH v7 2/3] mm: vmscan: add cgroup IDs to vmscan tracepoints Thomas Ballasi
2026-02-23 19:34 ` Shakeel Butt
2026-02-23 17:15 ` [PATCH v7 3/3] mm: vmscan: add PIDs " Thomas Ballasi
2026-02-23 19:42 ` Shakeel Butt
2026-02-23 23:30 ` Masami Hiramatsu [this message]
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=20260224083014.66bf222ffd81a3ebaa57a0e0@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=rostedt@goodmis.org \
--cc=shakeel.butt@linux.dev \
--cc=tballasi@linux.microsoft.com \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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