Linux's Preempt Lazy Support Coming To POWER CPUs

Written by Michael Larabel in Linux Kernel on 27 December 2024 at 06:13 AM EST. 3 Comments
LINUX KERNEL
Linux 6.13 is introducing a new Lazy Preemption mode with the "PREEMPT_LAZY" option. The lazy preemption mode is similar to full preemption but is less eager to preempt normal (SCHED_NORMAL) tasks. The goal is on reducing lock holder preemption and obtaining some of the performance gains found under the voluntary preemption mode. For Linux 6.13 the lazy preemption mode was exposed for x86/x86_64, RISC-V, and later added for LoongArch. Likely with the upcoming Linux 6.14, lazy preempt should work on POWER platforms.

There is a patch queued up by an IBM engineer for adding preempt lazy support to PowerPC hardware. That patch from Shrikanth Hegde explains:
powerpc: Add preempt lazy support

Define preempt lazy bit for Powerpc. Use bit 9 which is free and within 16 bit range of NEED_RESCHED, so compiler can issue single andi.

Since Powerpc doesn't use the generic entry/exit, add lazy check at exit to user. CONFIG_PREEMPTION is defined for lazy/full/rt so use it for return to kernel.

Ran a few benchmarks and db workload on Power10. Performance is close to preempt=none/voluntary.

Since Powerpc systems can have large core count and large memory, preempt lazy is going to be helpful in avoiding soft lockup issues.

That patch has made it to PowerPC.git's "next-test" branch -- one step away from the "next" branch.

POWER9 CPUs with Raptor Talos II


Given the better part of a month to go until the Linux 6.14 merge window kicks off, it's looking more than likely that this lazy preemption for IBM POWER / OpenPOWER processors will come with Linux 6.14.
Related News
About The Author
Michael Larabel

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

Popular News This Week