Intel boffins have emerged from their smoke-filled labs claiming to have produced a Linux kernel optimisation that cuts memory hotplugging times, particularly for virtual machines and systems using CXL memory.
According to Phoronix the work is expected to arrive with Linux 7.4 and tackles an inefficient kernel check performed whenever memory is added to or removed from a running system.
Memory hotplugging lets you add RAM without shutting a machine down. It is particularly useful for virtual machines and servers using Compute Express Link, where memory capacity can change while workloads continue running.
Intel engineer Yuan Liu found that Linux repeatedly scanned an entire memory zone pageblock by pageblock to update whether that zone was contiguous. On large systems, that could become an expensive bit of housekeeping.
The new code introduces a pages_with_online_memmap value for each memory zone. Instead of repeatedly walking every pageblock, the kernel keeps track of how many pages have an online memory map and can determine the state much more quickly.
The resulting speed-up is substantial. Tests involving a virtual machine showed memory hotplug operations taking up to 81 per cent less time, while memory removal improved by as much as 75 per cent. Samsung testing found sizeable improvements when hotplugging CXL memory too, making the change particularly relevant as server makers begin treating memory as a pool that can be expanded and reassigned dynamically.
CXL allows processors, accelerators and memory devices to share a coherent high-speed interconnect. One of its more interesting uses is memory expansion, where servers can add capacity without stuffing yet more DIMMs beside each processor. That makes kernel overhead during memory changes increasingly important. Taking seconds off an operation might sound less glamorous than announcing another AI accelerator, but data-centre operators tend to develop an unhealthy interest in anything performed across thousands of machines.
The patch series went through 10 revisions before the memory-management development tree accepted it on 23 September. Maintainer David Hildenbrand placed it in the memhp-7.4.misc branch for integration with the Linux 7.4 development cycle.
Its presence in the development tree does not absolutely guarantee inclusion in the final kernel because patches can still be changed or dropped if problems emerge during testing. Barring unexpected breakage, it is lined up for the Linux 7.4 merge window.
It is a small kernel change compared with the headline features usually attached to new Linux releases, but an 81 per cent reduction in waiting time from avoiding unnecessary scans is difficult to argue with. Sometimes optimisation still means finding code doing something stupid repeatedly and persuading it to stop.







