Re: [PATCH] genirq: move clear of kstat_irqs to free_desc()

From: Luigi Rizzo

Date: Mon Jan 12 2026 - 03:34:32 EST


On Sun, Jan 11, 2026 at 8:17 PM Luigi Rizzo <lrizzo@xxxxxxxxxx> wrote:
>
> desc_set_defaults() has a loop to clear the per-cpu counters kstats_irq.
>
> This is only needed in free_desc(), which is used with non-sparse IRQs
> so that the irq_desc can be recycled. For newly allocated irq_desc,
> the memory comes from alloc_percpu() and is already zeroed out.
>
> Move the loop to free_desc() to avoid wasting time unnecessarily.

...

ah I forgot to move the "int cpu;" line, just sent a corrected [PATCH v2]

cheers
luigi