Re: [PATCH v4 0/7] PCI: Resource placement algorithm fixe
From: Maciej Grochowski
Date: Tue Nov 03 2026 - 02:20:38 EST
Hi Ilpo,
Thanks for the update. We already had the v4 backport in testing when
you asked us to wait for v5, so here are Mesih's sizing results.
Our setup has an AST2720 root complex, a Microchip PM50052 switch and
eight Microchip PCI1003 devices. The BAR resource sizes per PCI1003 are:
16 MiB + 16 MiB + 4 MiB = 36 MiB
That gives 288 MiB across all eight devices.
The prefetchable bridge window is still 387 MiB with v4, the same as v2,
compared with 384 MiB using our local max() -> ALIGN() workaround.
Looking at pbus_size_mem(), I think the extra 3 MiB may come from three
unused prefetchable bridge windows: 0001:02:08.0, 09.0 and 0a.0. One
branch is empty; the other two have Pericom UARTs with non-prefetchable
BARs.
V4 keeps:
size += max(r_size, align);
For a zero-sized window aligned to 1 MiB, max() contributes 1 MiB, while
ALIGN() contributes zero. That would account for the difference if all
three resources reach this loop. Together with 96 MiB of alignment
padding, this gives 387 MiB instead of 384 MiB.
pbus_size_mem_optional() returns false when realloc_head is NULL, but we
have not yet traced the resource flags and alignment at each level to
confirm this explanation.
Is that minimum contribution intentional for empty prefetchable windows,
or should zero-sized windows be skipped in this pass?
So far we have compared sizing only. We do not yet have a complete
allocator trace or a verified v4 BAR-assignment result.
Thanks,
Maciej