The Linux Kernel Will Be Able To Detect Split-Locks To Then Warn Or Kill Offending Apps

Written by Michael Larabel in Linux Kernel on 5 February 2020 at 12:05 AM EST. 9 Comments
LINUX KERNEL
Not yet mainlined in the Linux kernel but currently queued as part of the x86/cpu changes for next round is the ability for the kernel to detect split locks and either warn the offending applications or kill the processes.

Split locks are when an atomic instruction operates on data spanning multiple cache lines. Due to the atomic nature, a global bus lock is needed when working on two cache lines and that in turn causes a big performance hit for the overall system performance.

This Linux kernel support for detecting split locks is contingent upon x86_64 CPUs supporting the capability for generating alignment check exceptions (#AC) on encountering a split lock. For now the necessary MSR appears to be only supported on Intel CPUs.

By default on supported CPUs the Linux kernel will warn via dmesg when a split lock happens and the offending process. But split_lock_detect=fatal can also be set as a kernel argument where it will send a fatal SIGBUS to the application causing the split lock... The fatal mean being a very transparent way of seeing when a split-lock happens so it can ideally be addressed in the software.

The split lock detection for the Linux kernel is currently queued in x86/cpu. The patch has yet to be mainlined but given the timing may end up being held off until Linux 5.7 rather than making it into 5.6 with its merge window wrapping up this week.
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