Re: [RFC PATCH v2 9/9] rv: Test IRQ-exit softirq provenance and handoff

From: Karl Mehltretter

Date: Sun Nov 22 2026 - 15:21:13 EST


On Sat, Nov 21, 2026 at 03:01:13PM +0100, Gabriele Monaco wrote:
> On Sat, 2026-11-07 at 18:12 +0100, Karl Mehltretter wrote:
> > On PREEMPT_RT, verify that worker events do not report hardirq provenance.
> > Do not run the synthetic inline IRQ-exit cases there. IRQ exit defers
> > softirqs to workers, and serving-softirq state is task-local rather than
> > encoded solely in preempt_count().
> >
> > Snapshot reaction counts inside synthetic IRQ-disabled and hardirq
> > intervals, then evaluate the KUnit expectations after restoring normal task
> > context.
> >
> > Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
>
> I still couldn't read the KUnit tests, but from what I get quickly scanning
> these, it's massive. A total of almost 3k lines of KUnit tests for 2 simple
> models is probably a bit much.

Agreed. I'll cut the KUnit tests down to a much smaller set focused on
the monitor transitions.

>
> Keep in mind you are testing your unit, which is an RV monitor, so you may want
> to stress transitions, mess around with the environment as little as you can
> (e.g. disable interrupts) and use mocks/stubs where you can. It isn't always
> easy, but the fact you're touching softirq.c doesn't look right. Your
> unit isn't the softirq machinery, you should interact with it as least as
> possible.

Makes sense. I'll drop the test hooks from softirq.c and simulate the
events instead.

I'll address your comments on the other patches as well.

Thanks,
Karl