Linux 6.14 will fix 30% performance regression!
Ahead of the stable release expected on March 23rd, a patch entered the Linux kernel that was categorized as urgent. This commit made it to the Linux kernel tip repository two years ago, and it seemed interesting at first.
This commit that we linked above reduced the “cost of sched_move_task
when config autogroup” in the task scheduling function in the kernel where some sched_move_task
calls were deemed as “useless” because the sched_task_group
variable in task_struct might not have been changed when automatic grouping of tasks is enabled. As a result, the commit added a conditional statement that checks to see if the group that was obtained via the sched_get_task_group
function was the same as the sched_task_group
variable from the task pointer, and jumps to the unlock
label, should the condition be evaluated to true
. In order to do that, the sched_change_group
function has been changed so that it takes the second parameter denoting the task group struct pointer.
However, this was proven to be inefficient, as it caused regressions in performance, hurting other Linux workloads, such as UnixBench’s spawn test experiencing 30% performance regression. This regression was reported by an Amazon engineer when performing tests on the AWS cloud with automatic grouping enabled for task groups.
Today, this patch has been released to the kernel tip repository, and the committer has done a pull request stating that the patch that reverts the commit that caused regressions should be merged to Linux 6.14. The merge note stated that it was “admittedly a bit late in the cycle, and the regression is old, but the performance impact is substantial for the affected workloads,” and that the author didn’t want to delay the fix.
We’ll see if this urgent fix will make it to 6.14 or to any later release. Besides, it may get backported to older but supported Linux version series to increase the performance of your computer.