Re: [PATCH] genirq/manage: Reduce priority of forced secondary IRQ handler

From: Thomas Gleixner

Date: Sun Sep 21 2025 - 14:15:18 EST


On Sun, Sep 21 2025 at 15:12, Lukas Wunner wrote:
> On Sat, Sep 20, 2025 at 11:20:26PM +0200, Thomas Gleixner wrote:
> Your research that at first glance, at least 21 of 40 instances of
> request_threaded_irq() could just use IRQF_NO_THREAD, seems to
> support the notion that the majority of interrupt handlers only
> do minimal work in hard interrupt context.
>
> But if that is the case, and if you believe that deferring that
> small amount of work to a thread is nonsensical, then why is the
> primary handler forced into a thread by default in the first place,
> requiring drivers to explicitly opt out by setting IRQF_NO_THREAD?

Because there are primary handlers which are absolutely not RT safe.

> Shouldn't it rather be the other way round, i.e. by default the
> primary handler is *not* forced into a thread, but only if the
> driver explicitly opts in? (In cases where the primary handler
> does a sufficient amount of work that is justified to be deferred
> to a thread.)

We had to do it this way before RT got upstream as there was no way to
play a whack a mole game with drivers constantly being added and
changed.

Thanks,

tglx