Ingo Molnar presented the second version of a patch set that significantly reduces kernel rebuild time by restructuring the hierarchy of header files and reducing cross-dependencies. Compared to the first version proposed a few days ago, this new version adapts to kernel 5.16-rc8, adds additional optimizations, and implements support for building with the Clang compiler. When using Clang, applying the patches allowed the build time to decrease by 88% or 77% in CPU resource usage metrics. During a full kernel rebuild with the command 'make -j96 vmlinux', the build time dropped from 337.788 to 179.773 seconds.
The new version also resolves issues with GCC plugins, fixes errors identified during the initial review process, and unifies duplicate declarations of the 'task_struct_per_task' structure. Additionally, optimization of the linux/sched.h header file continues, and optimization of the RDMA (infiniband) subsystem header files has been implemented, which further reduced build time by 9% compared to the first version of the patches. The number of C files in the kernel that include the linux/sched.h header file has been reduced from 68% to 36% compared to the first version of the patches (from 99% to 36% compared to the original kernel).
Source: opennet.ru
