Re: [PATCH 8/8] io_uring: keep interrupts on on submit completion

Jens Axboe
2021-01-25T16:05:13Z

On 1/25/21 4:42 AM, Pavel Begunkov wrote:
> We don't call io_submit_flush_completions() in interrupt context, no
> need to use irq* versions of spinlock.

_irq() isn't safe to use from IRQ context, it would have to be
_irqsave() for that. So the point here isn't to ensure that we work from
IRQ context, it's to protect against a deadlock when the lock is _also_
grabbed from IRQ context. And for that, we need to make sure that IRQs
are disabled, if this lock is already grabbed from IRQ context.

So this patch is wrong, the code is correct as-is.

--
Jens Axboe