]> git.ipfire.org Git - thirdparty/systemd.git/commit
modules-load: implement parallel module loading main
authorFrancesco Valla <francesco@valla.it>
Sun, 27 Jul 2025 21:50:06 +0000 (23:50 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Nov 2025 13:12:56 +0000 (14:12 +0100)
commit840549989fa43513ced4ce41ebe741176b4a3890
treea57421c20e8b49fa083f9d35c21350bf11efb25e
parentdf79e5b97ea9a955e325d9522cb42d182b93a032
modules-load: implement parallel module loading

Load modules in parallel using a pool of worker threads. The number of
threads is equal to the number of CPUs, with a maximum of 16 (to avoid
too many threads being started during boot on systems with many an high
core count, since the number of modules loaded on boot is usually on
the small side).

The number of threads can optionally be specified manually using the
SYSTEMD_MODULES_LOAD_NUM_THREADS environment variable; in this case,
no limit is enforced. If SYSTEMD_MODULES_LOAD_NUM_THREADS is set to 0,
probing happens sequentially.

Co-authored-by: Eric Curtin <ecurtin@redhat.com>
docs/ENVIRONMENT.md
src/modules-load/modules-load.c
test/units/TEST-87-AUX-UTILS-VM.modules-load.sh