Re: [patch v2 09/14] genirq: Expose irq_find_desc_at_or_after() in core code

From: Dmitry Ilvokhin

Date: Thu Mar 26 2026 - 15:22:25 EST


On Fri, Mar 20, 2026 at 02:22:09PM +0100, Thomas Gleixner wrote:
> --- in preparation for a smarter iterator for /proc/interrupts.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
> ---
> kernel/irq/internals.h | 2 ++
> kernel/irq/irqdesc.c | 12 +++++-------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>

[...]

>
> -static unsigned int irq_find_at_or_after(unsigned int offset)
> +struct irq_desc *irq_find_desc_at_or_after(unsigned int offset)
> {
> unsigned long index = offset;
> - struct irq_desc *desc;
> -
> - guard(rcu)();

Is the drop of guard(rcu)() intentional here? irq_get_next_irq()
dereferences the returned pointer after mt_find() has dropped
rcu_read_unlock(). Should it hold its own guard(rcu)() to keep the same
behaviour as before?