Re: [patch v2 06/14] genirq: Cache the condition for /proc/interrupts exposure

From: Radu Rendec

Date: Tue Mar 24 2026 - 16:40:02 EST


On Tue, 2026-03-24 at 21:31 +0100, Thomas Gleixner wrote:
> On Mon, Mar 23 2026 at 16:58, Radu Rendec wrote:
> > > +void irq_proc_update_valid(struct irq_desc *desc)
> > > +{
> > > + u32 set = _IRQ_PROC_VALID;
> > > +
> > > + if (irq_settings_is_hidden(desc) || !desc->action ||
> > > +     irq_desc_is_chained(desc) || !desc->kstat_irqs)
> >
> > Can desc->kstat_irqs ever be NULL? Looking at kernel/irq/irqdesc.c, it
> > seems to me that it's allocated always and very early (before every
> > other field in struct irq_desc), and with an explicit check for NULL on
> > allocation. It's also deallocated late, right before struct irq_desc
> > itself is deallocated (in irq_kobj_release()).
>
> Well spotted. That's a left over from histerical code.

Thanks for confirming! I was intrigued because you removed that check
in a previous patch, and I looked. And while looking, I noticed there
were quite a few other spots where the check was still done, and I
wanted to ask you anyway. I'll prepare a cleanup patch and send it.