From: Ridong Chen <ridong.chen@linux.dev>
To: sashiko-reviews@lists.linux.dev
Cc: hannes@cmpxchg.org, linux-trace-kernel@vger.kernel.org,
tj@kernel.org, mkoutny@suse.com
Subject: Re: [PATCH RFC v2 7/7] mm/vmscan: pass scan_control to mm_vmscan_balance_pgdat_end
Date: Tue, 29 Sep 2026 10:01:49 +0800 [thread overview]
Message-ID: <129d5af2-81a8-4465-b5a4-617b88bab748@linux.dev> (raw)
In-Reply-To: <20260928115827.18B291F00893@smtp.kernel.org>
On 9/28/2026 7:58 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] mm: BPF raw tracepoint ABI breakage and commit message mismatch in mm_vmscan_balance_pgdat_end
> --
>
> commit eb8bc6091aab714af4b68f316fecfc08d43c39dc
> Author: Ridong Chen <chenridong@xiaomi.com>
>
> mm/vmscan: pass scan_control to mm_vmscan_balance_pgdat_end
>
> This commit updates the mm_vmscan_balance_pgdat_end tracepoint to receive
> a struct scan_control pointer rather than passing individual struct fields.
> It updates the TP_PROTO and TP_ARGS while leaving the exported event format
> unchanged.
>
>> balance_pgdat() passes sc.order and sc.nr_reclaimed to
>> mm_vmscan_balance_pgdat_end as bare arguments. Pass the enclosing
>> struct scan_control instead and read the fields out in TP_fast_assign,
>> mirroring mm_vmscan_balance_pgdat_begin. highest_zoneidx stays a
>
> [Severity: Medium]
> The commit message states this change is "mirroring
> mm_vmscan_balance_pgdat_begin." Is this description accurate?
>
> Looking at mm_vmscan_balance_pgdat_begin in mm/trace_vmscan.h, it still takes
> individual arguments and was not updated to take struct scan_control *sc:
>
> TRACE_EVENT(mm_vmscan_balance_pgdat_begin,
> TP_PROTO(int nid, int order, int highest_zoneidx),
>
> Could the commit message be more precise about the rationale?
>
You're right, that wording is misleading and I'll fix it in next version.
I just mixed it up with other xxx_begin tracepoints.
>> diff --git a/mm/trace_vmscan.h b/mm/trace_vmscan.h
>> index 04f285e776596..c27bc7cc60630 100644
>> --- a/mm/trace_vmscan.h
>> +++ b/mm/trace_vmscan.h
> [ ... ]
>> @@ -124,10 +124,9 @@ TRACE_EVENT(mm_vmscan_balance_pgdat_begin,
>>
>> TRACE_EVENT(mm_vmscan_balance_pgdat_end,
>>
>> - TP_PROTO(int nid, int order, int highest_zoneidx,
>> - unsigned long nr_reclaimed),
>> + TP_PROTO(int nid, struct scan_control *sc, int highest_zoneidx),
>>
>> - TP_ARGS(nid, order, highest_zoneidx, nr_reclaimed),
>> + TP_ARGS(nid, sc, highest_zoneidx),
>
> [Severity: Medium]
> The commit message mentions there is "No functional change", but could this
> modification break existing BPF programs hooked to this tracepoint?
>
> While standard trace events parse the formatted output, BPF raw tracepoints
> consume the TP_PROTO arguments directly via ctx->args. Changing the number
> and type of arguments alters the BPF raw tracepoint ABI for this event.
>
> Does this inadvertently break user space tools that attach to this raw
> tracepoint and expect the 4 original arguments?
>
Thanks, "No functional change" is inaccurate here.
Kernel behaviour and the tracefs format are unchanged (TP_STRUCT__entry /
TP_printk are untouched), so perf / trace-cmd / libbpf CO-RE consumers are
unaffected. But for BPF raw tracepoints the arg layout does change: a program
reading the old args[3] (nr_reclaimed) now has to read it out of sc. I
shouldn't have hidden that under "no functional change".
Raw tracepoints aren't a stable ABI though
(Documentation/bpf/bpf_design_QA.rst), so the change itself is fine — I'll just
fix the commit message in next version.
--
Best regards
Ridong
prev parent reply other threads:[~2026-09-29 2:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 11:46 [PATCH RFC v2 0/7] mm/vmscan: move vmscan tracepoints to a local header Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 1/7] mm/memcontrol: drop unused vmscan tracepoint include Ridong Chen
2026-09-28 12:08 ` Muchun Song
2026-09-29 1:23 ` Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 2/7] mm/vmscan: move vmscan tracepoints to a local header Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 3/7] mm/vmscan: move struct scan_control to a dedicated header Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 4/7] mm/vmscan: pass scan_control to the reclaim-begin tracepoints Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 5/7] mm/vmscan: pass scan_control to the LRU isolate/shrink tracepoints Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 6/7] mm/vmscan: pass scan_control to mm_vmscan_reclaim_pages Ridong Chen
2026-09-28 11:46 ` [PATCH RFC v2 7/7] mm/vmscan: pass scan_control to mm_vmscan_balance_pgdat_end Ridong Chen
2026-09-28 11:58 ` sashiko-bot
2026-09-29 2:01 ` Ridong Chen [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=129d5af2-81a8-4465-b5a4-617b88bab748@linux.dev \
--to=ridong.chen@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tj@kernel.org \
/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