Boosting Linux Power Efficiency with Kernel Scheduler Updates
From data centers to embedded sensors, energy use is one of the toughest issues facing computing. The Linux kernel community has already made great progress in boosting energy efficiency, but there's still more work to be done to optimize Linux systems, with one area of focus on power-aware scheduling.
LWN editor Jon Corbet presented an overview of the issues and potential solutions for improving power management with the kernel scheduler in his Linux kernel weather forecast keynote last week at Collaboration Summit in San Francisco. And breakout session presentations by Preeti Murthy, a software engineer at IBM, and Morten Rasmussen, who works on the power management team at ARM, went into further detail on the kernel changes. All three presentations are available on YouTube and embedded here for your convenience.
Corbet summarized the problem by first explaining what the kernel does well. A Linux machine can drop into a deep, low-power idle state for long periods of time when the processor has no work to do. In fact, he said, "Linux is more efficient at doing nothing than anything else out there at this point." On the other end of the spectrum, when a system is running flat out on a big task, there isn't much room for improvement because it needs all the available processing power, Corbet said.
It's the area in between, when the system is "moderately loaded", that Linux could be more efficient, he said. That means instead of spreading the workload across all CPUs in a system, the load would be shifted to a subset of CPUs while the others shut down to save power.
To accomplish this, kernel developers have a few proposed solutions to improve the scheduler, the section of the kernel responsible for assigning CPU space to various tasks. One class of patchsets for symmetric multi-processing systems (with identical CPUs) groups small tasks together on a few processors, while spreading big jobs out across processors that can then return to idle quickly. While the big.LITTLE ARM architecture, which pairs large and small processors together in a heterogeneous patchwork, has its own set of solutions.
The Power-Aware Scheduler
Preeti Murthy gave an overview of the power-aware scheduler, which is not yet part of the mainline kernel, and how it achieves load balancing across groups of processors. She gave more detail on the per-entity load-tracking metric patchset, which would allow the scheduler to calculate percent utilization of the processor as the basis for distributing individual tasks to under-utilized CPUs.
"The goal going forward is to integrate CPU idle drivers and the scheduler so they can communicate and do better scheduling," Murthy said.
Morten Rasmussen went further still into task load tracking in his Tuesday session. He reported some encouraging results in a test of the patchset, which saw 36 percent less energy use when running an Ubuntu MP3 playback program on an ARM big. LITTLE test chip.
"It's important to make informed decisions about where to place tasks," Rasmussen said. "If you place it on a big core it will run really fast but you’ll pay more energy per instruction than if you were excecuting the same task on a little CPU.
"Suddenly you need to consider what kind of task I have and is it really worth running it faster but paying more in terms of energy?" he said. "...The strategy is to not use the high performance cores unless it’s absolutely necessary because they will drain your battery faster."
Despite encouraging work, however, Murthy anticipates that convincing the rest of the kernel community to adopt proposed scheduler changes will take some time.
"Scheduling is a very core part of Linux and if you try to change its behavior, like the way we are doing now, the kernel maintainers don’t really like it. Nor do the developers," Murthy said. "They would like very good experimental results to back it up (without regressions).”
A full selection of videos from Collaboration Summit is now available on video.linux.com.