Serdar Yegulalp
Senior Writer

Linux scheduler bug got you down? Here’s a fast fix

news analysis
Apr 22, 20163 mins

Bugs in the Linux scheduler can cause performance degradation in heavily multithreaded loads, but a do-it-yourself fix is available

First aid kit > help / fix / patch / remedy / recovery
Credit: Thinkstock

The Linux kernel scheduler has deficiencies that prevent a multicore system from making proper use of all cores for heavily multithreaded loads, according to a lecture and paper delivered earlier this month at the EuroSys ’16 conference in London,

If you’re running applications that might be affected and would rather not wait for a fix from the kernel team, a patch is available in a script provided by a third party.

The paper, titled “The Linux Scheduler: a Decade of Wasted Cores,” was authored by a sextet of researchers from the University of British Columbia and four other institutions. It describes four bugs in the kernel scheduler that cause some CPU cores to remain idle even when runnable threads are waiting to be dispatched to a core.

“Resulting performance degradations are in the range 13-24% for typical Linux workloads,” the researchers say, “and reach 138× in some corner cases.”

linux scheduler bug https://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf

CPU activity in a Linux system affected by the scheduler bug. The graph on the left shows two cores not receiving a fair allotment of threads due to the bug. The graph on the right shows the CPU after applying the fix suggested by the researchers.

The bug does not affect desktop users. As noted in a discussion thread on Hacker News, the issue involves complexities that arise when using the Linux scheduler on multiprocessor systems. The algorithm used by the scheduler to balance the load across cores fails in certain circumstances — for instance, when a thread that was previously asleep is awakened on an overloaded core, while other cores are not in use.

The paper describes one test with apps written in the R language that hints at how the problem might arise when doing math and statistical work in multicore Linux environments.

Such bugs don’t always announce their presence with a crash or a hang, but rather via degraded performance, so they aren’t always obvious, the researchers say.

The patches suggested by the researchers don’t appear to have been submitted yet to the Linux kernel maintainers. But those running heavy multicore loads on Ubuntu can apply the patches immediately with a script available on GitHub. The script obtains the dependencies needed to build the kernel, applies the needed patches, and gives the option to either install the kernel then and there or build it into a .deb package for use elsewhere.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author