Thanks Oracle! New Patches Pending Can Reduce Linux Boot Times Up To ~49%
Back in 2017 the Oracle Linux Kernel Team announced KTask for in-kernel multi-threading for CPU intensive tasks. The KTask framework never made it into the mainline Linux kernel but has been in use with Oracle Linux's Unbreakable Enterprise Kernel. But now a newer iteration of the patch series has been published that is focused just on being able to handle multi-threaded jobs with PADATA.
Linux's PADATA is a parallel execution mechanism for running jobs on multiple CPUs while retaining task ordering. PADATA in its present form runs in parallel may single-threaded jobs but with the work out of Oracle it can handle multi-threaded jobs by splitting up the work evenly across CPU cores. This patch series gets PADATA ready for multi-threading with the initial user being deferred struct page init, as a major bottleneck in the Linux boot process.
Oracle's Daniel Jordan noted, "This has been tested on a variety of x86 systems and speeds up kernel boot by 6% to 49% by making deferred init 63% to 91% faster." Oracle is seeing great performance out of this parallelization work at boot time especially on multi-node setups with large quantities of RAM. This work not only benefits bare metal systems but also the time for firing up VMs, which is important for cloud use-cases especially if needing to respond to changing capacity/demand.
An Intel kernel developer also commented that on a test system he found the time it took to hit /sbin/init was nearly halved and "That makes a huge difference; memory initialization is the largest remaining component of boot time."
These patches in their current form are exciting, but this is just the start. Separate from this initial PADATA multi-threaded jobs support and initial user, there are more patches in the works for being able to parallelize more kernel tasks.
Let's hope the code review goes well and this work can find its way soon into the mainline kernel (Linux 5.8 perhaps if going fast enough). For now the work can be found on the kernel mailing list.