I captured the time to build the generic and trimmed kernels using 3, 7, 15, and 31 CPU cores. Previously, the generic build took ~ 43 minutes consuming 3 CPU cores. The Feb-2024 update 2 decreased the time. A trimmed build saves beaucoup time and storage utilization.
The /lib/modules/[kernel]
size includes the NVIDIA driver on my machine.
Generic kernel (all modules configured in Clear config - default):
$ ./fetch-src main
$ time ./xm-build main-preempt
3 CPUs 7 CPUs 15 CPUs 31 CPUs
real 41m35.725s 19m 5.350s 10m 5.097s 6m10.755s
user 112m 7.095s 114m12.451s 117m40.371s 127m55.995s
sys 9m38.373s 9m49.154s 10m39.254s 12m 2.763s
$ ls -lh rpmbuild.main/RPMS/x86_64/
total 106M
... 71M Feb 15 15:31 linux-xmmain-preempt-6.6.16-133.x86_64.rpm
... 109K Feb 15 15:31 linux-xmmain-preempt-cpio-6.6.16-133.x86_64.rpm
... 16M Feb 15 15:31 linux-xmmain-preempt-dev-6.6.16-133.x86_64.rpm
... 20M Feb 15 15:31 linux-xmmain-preempt-extra-6.6.16-133.x86_64.rpm
... 55K Feb 15 15:31 linux-xmmain-preempt-license-6.6.16-133.x86_64.rpm
$ ./xm-install main-preempt
$ du -sh /lib/modules/6.6.16-133.xmmain-preempt/
456M /lib/modules/6.6.16-133.xmmain-preempt/
Trimmed kernel (only the modules you have running; LOCALMODCONFIG=1):
$ time LOCALMODCONFIG=1 ./xm-build main-preempt
3 CPUs 7 CPUs 15 CPUs 31 CPUs
real 10m 0.565s 4m54.692s 2m52.431s 1m59.312s
user 26m25.156s 26m49.352s 27m31.223s 29m44.517s
sys 2m 3.640s 2m 6.321s 2m13.948s 2m28.507s
$ ls -lh rpmbuild.main/RPMS/x86_64/
total 51M
... 16M Feb 15 15:42 linux-xmmain-preempt-6.6.16-133.x86_64.rpm
... 89K Feb 15 15:42 linux-xmmain-preempt-cpio-6.6.16-133.x86_64.rpm
... 16M Feb 15 15:42 linux-xmmain-preempt-dev-6.6.16-133.x86_64.rpm
... 19M Feb 15 15:42 linux-xmmain-preempt-extra-6.6.16-133.x86_64.rpm
... 55K Feb 15 15:42 linux-xmmain-preempt-license-6.6.16-133.x86_64.rpm
$ ./xm-install main-preempt
$ du -sh /lib/modules/6.6.16-133.xmmain-preempt/
190M /lib/modules/6.6.16-133.xmmain-preempt/
Indeed, what a time saver! Some aspect of the build process consumes one CPU core, but mostly parallel. Clock speed decreases when consuming more CPU cores.