Linux Kernel Performance Bottlenecks Spotted By Mold Developer

Written by Michael Larabel in Linux Kernel on 28 November 2024 at 09:32 AM EST. 33 Comments
LINUX KERNEL
Open-source developer Rui Ueyama who is the lead developer of the Mold high performance linker and previously on the LLVM lld linker has written a detailed mailing list post that highlights some observed performance bottlenecks within the Linux kernel.

In developing the high speed Mold linker that sharply outperforms the GNU and LLVM linkers, Rui has noticed some areas of the Linux kernel becoming a bottleneck for the linker. The hope is these areas could be improved upon within the Linux kernel moving forward for allowing even better performance.

The key takeaways of the performance bottlenecks within the Linux kernel that were noticed by Rui Ueyama include:

- exit(2) takes a few hundred milliseconds for a large process

- Writing to a fresh file is slower than writing to an existing file

- Lack of a safe system-wide semaphore


The observation of a fresh file being slower than writing to an existing file is interesting and Rui elaborated:
"mold can link a 4 GiB LLVM/clang executable in ~1.8 seconds on my machine if the linker reuses an existing file and overwrites it. However, the speed decreases to ~2.8 seconds if the output file does not exist and mold needs to create a fresh file. I tried using fallocate(2) to preallocate disk blocks, but it didn't help. While 4 GiB is not small, should creating a file really take almost a second?"

Those interested in all the details noticed by the Mold developer around the Linux kernel can be found via this Linux kernel mailing list thread.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week