Linux Exec Should Be Less Deadlock Prone In Future Kernels
Written by Michael Larabel in Linux Kernel on 6 April 2020 at 07:07 AM EDT. Add A Comment
LINUX KERNEL --
Ongoing work around Linux's exec() code should make it less deadlock prone in future kernel versions.

The current exec functionality within the kernel is "extremely deadlock prone" but Eric Biederman and others have been working to clean up that code and put it in a better state to avoid potential deadlocks. Sent in for the Linux 5.7 kernel was the first part of the exec rework that makes trickier cases easier to spot and the hope is for Linux 5.8 the code to solve exec deadlocks might be ready.

Linus Torvalds pulled the proc/exec changes into the Linux 5.7 kernel but provided feedback that has ignited a lengthy discussion on the topic. Linus noted, "I've pulled it, but I'm not entirely happy about some of it...This code is subtle as h*ll, and we've had bugs in it, and it has a series of tens of patches to fix them. But that also means that the explanations for the patches should take the subtleties into account, and not gloss over them with things like this. Ok, enough about the explanations. The actual _code_ is kind of odd too."

At least in the near-term, however, there might be more frustrations. Stemming from another unmerged patch, Torvalds wrote, "There is no way I would ever take that patch. The amount of confusion in that patch is not acceptable. Randomly unlocking the new lock? That code makes everything worse, it's completely incomprehensible, the locking rules make no sense what-so-ever. I'm seriously starting to feel like I should not have pulled this code, because the future looks _worse_ than what we used to have." Torvalds messages though have been with poise compared to how he would often provide colorful commentary in the past over less than stellar code.

The good news is that due to Torvalds' intervention, more developers are discussing this fragile code hopefully leading to further improvements and ideally seeing the deadlock prone code addressed in time for the Linux 5.8 cycle if not seeing any pressing fixes come sooner.
Related News
About The Author
Author picture

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 or contacted via MichaelLarabel.com.

Popular News This Week