Re: [PATCH] irqchip/gic-v3: Remember each CPU's redistributor from the init walk

From: Marc Zyngier

Date: Sun Oct 25 2026 - 06:48:50 EST


On Fri, 23 Oct 2026 19:15:10 +0100,
Joshua Machauer <machaujo@xxxxxxxxx> wrote:
>
> From: Joshua Machauer <machaujo@xxxxxxxxxx>
>
> On systems that give every CPU its own redistributor frame, a CPU coming

Is there *any* sort of GICv3-based systems that do not match this
description?

> online finds its frame by walking the frames from the first one until
> GICR_TYPER matches its affinity. CPU n therefore performs O(n) MMIO
> reads, and bringing up N CPUs costs O(N^2). Secondary CPUs boot
> serially, so all of it adds to boot time.
>
> gic_update_rdist_properties() already walks every frame once at boot.
> Record each possible CPU's frame there and have gic_populate_rdist() try
> it first, so bringing a CPU online costs one MMIO read. A CPU without a
> recorded frame, such as an ACPI online-capable CPU absent at init, still
> scans.
>
> Recording compares each frame's affinity against that of every possible
> CPU. That is still O(N^2) work at init, but it reads cpu_logical_map[],
> which stays in the cache, instead of device memory.
>
> The frame is kept apart from rd_base, which
> inherit_vpe_l1_table_from_rd() reads as "this CPU has booted".

But this is a pointless duplication of the existing tracking, which
could equally be solved with a flag.

I'm not opposed to this, even if the gains are vanishingly small. But
it can't come at the cost of duplicated state.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.