Thread (40 messages) flat view 40 messages, 5 authors, 12d ago

Re: [PATCH v4 1/1] powerpc: enable dynamic preemption

From: Jirka Hladky <hidden>
Date: 2026-07-28 00:27:25
Also in: lkml

On Mon, Jul 27, 2026 at 7:10 PM Shrikanth Hegde [off-list ref] wrote:
That's full preemption mode.

When preemption mode changes preempt_enable/disable which were just a
barrier earlier now become real preemption points. If the code path
repeatedly does the exact same thing, it might pop up.
But, can we say is that number expected? it is difficult to put a
number to it.
You were right -- my previous test conflated two variables. I've now
built a third kernel to separate them. All three are from the same
6.15-rc6 source, same machine (POWER10 lp11), no PREEMPT_DYNAMIC:

Config                                    Mode        PREEMPT_RCU
kill bogo-ops/sec
------------------------------------   ----------  -----------
-----------------
PREEMPT_VOLUNTARY=y   voluntary   no            105,014
PREEMPT_LAZY=y                lazy           no              86,878
PREEMPT=y                           full             yes             73,317

voluntary -> lazy                                  -17.3%
lazy -> full+PREEMPT_RCU               -15.6%
voluntary -> full+PREEMPT_RCU       -30.2%

The regression splits roughly 55/45 between the preemption mode
change and PREEMPT_RCU:

1) voluntary -> lazy (-17.3%): preempt_disable/enable becoming real
   preemption points, as you predicted. On ppc64le this is expensive
   because the kill() syscall path is very tight and hits these
   points heavily.

2) lazy -> full+PREEMPT_RCU (-15.6%): __rcu_read_lock/__rcu_read_unlock
   requiring lwsync/isync barriers on ppc64le.
What I was asking is below. (You can do this only with below 7.0)

Config A: CONFIG_PREEMPT_VOLUNTARY=y (CONFIG_PREEMPT_DYNAMIC=n)
Config B: CONFIG_PREEMPT_VOLUNTARY=y (CONFIG_PREEMPT_DYNAMIC=y)
I couldn't do this exact test because 6.15-rc6 doesn't have
HAVE_PREEMPT_DYNAMIC_KEY for powerpc (that's your 6.16 patch), so
CONFIG_PREEMPT_DYNAMIC=y would be silently ignored. I would need a
6.16-6.19 kernel for this, which is before 7dadeaa6e851 removed
voluntary as an option.

But the PREEMPT_LAZY test above achieves the same goal: it isolates
the preemption mode cost without PREEMPT_RCU.
Are you saying you see regression with voluntary with
CONFIG_PREEMPT_DYNAMIC=y?
Yes. On the ELN kernels with CONFIG_PREEMPT_DYNAMIC=y, the regression
appears at 6.16 when HAVE_PREEMPT_DYNAMIC_KEY is added, because:
1) PREEMPT_DYNAMIC forces the runtime mode to lazy/full (voluntary
   is no longer available on architectures with ARCH_HAS_PREEMPT_LAZY)
2) PREEMPT_DYNAMIC pulls in PREEMPT_RCU

Both contribute to the ~30% total regression.

Jirka

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help