possible deadlock due to irq_set_thread_affinity() calling into the scheduler (was Re: [PATCH v3 38/62] KVM: SVM: Take and hold ir_list_lock across IRTE updates in IOMMU)
Thomas Gleixner
tglx at kernel.org
Thu Jan 8 13:53:47 PST 2026
On Thu, Jan 08 2026 at 22:28, Thomas Gleixner wrote:
> On Mon, Dec 22 2025 at 15:09, Paolo Bonzini wrote:
>> Of the three, the most sketchy is (a); notably, __setup_irq() calls
>> wake_up_process outside desc->lock. Therefore I'd like so much to treat
>> it as a kernel/irq/ bug; and the simplest (perhaps too simple...) fix is
>
> It's not more sketchy than VIRT assuming that it can do what it wants
> under rq->lock. :)
And just for the record, that's not the only place in the irq core which
has that lock chain.
irq_set_affinity_locked() // invoked with desc::lock held
if (desc->affinity_notify)
schedule_work() // Ends up taking rq::lock
and that's the case since cd7eab44e994 ("genirq: Add IRQ affinity
notifiers"), which was added 15 years ago.
Are you still claiming that this is a kernel/irq bug?
Thanks,
tglx
More information about the linux-arm-kernel
mailing list