Re: [PATCH v2] sched: set TIF_NEED_RESCHED before calling __trace_set_need_resched()

From: Gabriele Monaco

Date: Tue Jun 30 2026 - 04:58:38 EST


On Mon, 2026-06-29 at 23:05 +0530, K Prateek Nayak wrote:
> > That said, we should indeed add the tracepoint to that path and probably
> > adapt the monitor if that's making it fail indirectly.
>
> For the npr use-case, I think the current scheme is fine since
> only SM_PREEMPt counts as a "schedule_entry_preempt" transition
> and only that can transition the state machine out of the
> "any_thread_running" state.

Right, the monitor can live without it, but I wonder if we need to put that
tracepoint for correctness sake. After all, however unlikely, that's a
need_resched too.

(then if the monitor really saw a need_resched after it's sched_entry, it would
stay erroneously in rescheduling).

Anyway this all isn't related to the patch.

Thanks,
Gabriele