Re: [RFC PATCH v2 0/9] rv: Verify generic IRQ context transitions

From: Karl Mehltretter

Date: Sat Nov 28 2026 - 06:55:07 EST


On Sat, Nov 21, 2026 at 03:23:08PM +0100, Gabriele Monaco wrote:
> Maybe, you could somehow reuse the __schedule() tracepoints and understand you
> came from interrupt context, but that would obviously not match the
> interrupt/preemption counts, although they are (now) guarded by a BUG so you
> don't really need them.
> The loop should work fairly well anyway.
>

Good point. With the BUG_ON() in preempt_schedule_irq(), every irqexit
check is already enforced elsewhere.

It seems dropping irqexit and its scheduler tracepoints is best.

For irqstate, I injected faults on arm64 and x86_64, with and without
lockdep, and went through past IRQ context fixes:

- Its only unique catch was an injected traced entry paired with a raw
exit.
- A leaked PREEMPT_RT serving-softirq bit was reported first by RCU or
lockdep, even with lockdep compiled out.
- It would not have caught any of the past bugs I looked at. Most were
preempt_count disagreeing with lockdep, irqtime or nohz.
- On a Raspberry Pi 500+, it added about 73 ns to each
irq_enter_rcu()/irq_exit_rcu() pair and had no measurable effect on
hackbench or locktorture. PROVE_LOCKING added only 12 ns to the pair
but made hackbench eight times slower.

How do you see it? The results above only measure detection beyond the
existing checks. Is irqstate worth a v3 for other reasons, such as
running a model of the IRQ context rules on production kernels, or is
there something you would like me to investigate first?

Thanks,
Karl