Up to now the Linux kernel uses IO-based accesses for the first 256 bytes of configuration space with PCI Express, even when MMCONFIG is present that allows for mapping the PCIe device configuration space into memory so reads/writes can be done directly via memory accesses. The IO-based accesses are serialized while fortunately a patch is pending to use MMCONFIG to allow for faster PCIe initialization and in turn faster booting of the Linux kernel. Longtime open-source developer Josh Triplett has been working on a patch to prefer MMCONFIG for all PCIe configuration space accesses where supported by the hardware. In the patch message he explains of the current bottleneck on PCIe initialization with the IO-based approach compared to using MMCONFIG: "Even when MMCONFIG is available, PCIe currently defaults to IO-based accesses for the first 256 bytes of config space. IO-based accesses are serialized, and can cause substantial scalability issues when initializing a large number of devices on a system with many CPUs. (Those often coincide, because many systems have PCIe devices per CPU.) Prefer MMCONFIG even for the first 256 bytes of config space. The only systems known to have an issue with this are some K8 systems, where the BIOS advertises MMCONFIG but it fails for northbridge devices; disable this on such systems, and provide a `pci=no_prefer_mmconf` to in case any other such systems arise. Tested on an AWS c8i.48xlarge system, with 192 CPUs, over five boots with and five boots without. Without: PCI init 266ms Boot to minimal /init 726ms With: PCI init 213ms (~20% faster) Boot to minimal /init 661ms (~9% faster)" Up t0 20% faster PCI(e) initialization or around 9% faster for the overall boot process. The patch amounts to just around 50 lines of code. With the ability to disable the behavior in case of any problems, hopefully this optimization will soon make it to the mainline Linux kernel.
Linux PCIe Initialization ~20% Faster At Boot With Pending Patch
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.