November 1st, 2024

Linus Torvalds Lands 2.6% Performance Improvement with Minor Linux Kernel Patch

Linus Torvalds merged a patch improving Linux kernel performance by 2.6% by modifying the copy_from_user() function. It will be included in the upcoming Linux 6.12-rc6 release in November.

Read original articleLink Icon
Linus Torvalds Lands 2.6% Performance Improvement with Minor Linux Kernel Patch

Linus Torvalds has successfully merged a minor patch to the Linux kernel that achieves a 2.6% performance improvement in Intel's "will it scale" per-thread-ops benchmark. The patch, which Torvalds authored, modifies the 64-bit copy_from_user() function by eliminating the use of barrier_nospec(), a slow operation. Instead, it employs pointer masking to handle invalid addresses more efficiently. This change is expected to enhance performance in copying data from user-space to kernel-space, although its impact on other workloads remains to be seen. The optimization is particularly significant as it reduces the overhead associated with Spectre mitigations, which have previously imposed performance costs. The patch is set to be included in the upcoming Linux 6.12-rc6 kernel release, with the stable version expected later in November.

- Linus Torvalds authored a patch that improves Linux kernel performance by 2.6%.

- The patch modifies the 64-bit copy_from_user() function to avoid using barrier_nospec().

- Pointer masking is used to handle invalid addresses, enhancing efficiency.

- The performance improvement is based on Intel's per-thread-ops benchmark.

- The patch will be included in the Linux 6.12-rc6 release scheduled for November.

Link Icon 2 comments
By @willemlaurentz - 3 months
"all hail to the king" :-)