Re: [PATCH v3 12/17] sched: Adapt sched tracepoints for RV task model

From: Peter Zijlstra
Date: Wed Jul 16 2025 - 10:21:10 EST


On Wed, Jul 16, 2025 at 04:07:16PM +0200, Gabriele Monaco wrote:
> On Wed, 2025-07-16 at 15:45 +0200, Peter Zijlstra wrote:
> >
> > I'm not sure I understand the importance of IRQ state when describing
> > task transitions.
> >
> > You know both:
> >
> >  - schedule() invocations for any one task are in-order;
> >  - schedule() invocations for any one CPU are in-order.
> >
>
> It's to describe latencies, which is the original purpose of the
> scheduler model: if the event supposed to wake up an RT task occurs
> with interrupts disabled while scheduling, we'd need to wait for that
> run to complete.
> Now to be fair, it doesn't really matter whether that call to
> __schedule switches or not, but always having a switch event simplifies
> things while modelling.

So in general I'm a minimalist; less is more etc.

Even if you care about latencies, I don't see what that tracepoint
adds. In fact, I don't even see the point of the .is_switch argument to
trace_sched_exit_tp(). That state can be fully reconstructed from having
seen trace_sched_switch() between trace_sched_{enter,exit}_tp().

As for the IRQ state, if you see:

trace_sched_enter_tp();
trace_irq_disable();
trace_irq_enable();

You already know all you need to know; there was no switch, otherwise it
would'be been:

trace_sched_enter_tp();
trace_irq_disable();
trace_sched_switch();
trace_irq_enable();

Also, can we get rid of that CALLER_ADDR0 argument as well?