Re: [RESEND][PATCH v15 2/4] perf: Support deferred user callchains
From: Steven Rostedt <rostedt@kernel.org>
Date: 2025-09-23 12:36:26
Also in:
bpf, lkml
On Tue, 23 Sep 2025 12:32:13 +0200 Peter Zijlstra [off-list ref] wrote:
So the thing that stands out is that you're not actually using the
unwind infrastructure you've previously created. Things like: struct
unwind_work, unwind_deferred_{init,request,cancel}() all go unused, and
instead you seem to have build a parallel set, with similar bugs to the
ones I just had to fix in the unwind_deferred things :/
I'm also not much of a fan of nr_no_switch_fast, and the fact that this
patch is limited to per-task events, and you're then adding another 300+
lines of code to support per-cpu events later on.
Fundamentally we only have one stack-trace per task at any one point. We
can have many events per task and many more per-cpu. Let us stick a
struct unwind_work in task_struct and have the perf callback function
use perf_iterate_sb() to find all events that want delivery or so (or we
can add another per perf_event_context list for this purpose).
But duplicating all this seems 'unfortunate'.We could remove this and have perf only use the CPU version. That may be better in the long run anyway, as it gets rid of the duplication. In fact that was the original plan we had, but since Josh wrote this patch thinking it was all that perf needed (which ended not being the case), I still kept it in. But I believe this will work just the same as the CPU tracing which uses all the other infrastructure. -- Steve