LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Jirka Hladky <jhladky@redhat.com>
Cc: maddy@linux.ibm.com, linuxppc-dev@lists.ozlabs.org,
	christophe.leroy@csgroup.eu, mpe@ellerman.id.au,
	npiggin@gmail.com, bigeasy@linutronix.de, will@kernel.org,
	linux-kernel@vger.kernel.org,
	"Paul E . McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH v4 1/1] powerpc: enable dynamic preemption
Date: Mon, 27 Jul 2026 09:48:25 +0530	[thread overview]
Message-ID: <c0f51eda-21c4-4e9d-95e9-75b2740c3f43@linux.ibm.com> (raw)
In-Reply-To: <CAE4VaGBwMp3Ke1+Bt11-v6CCE0h=mPm8k_Cf8DazFSQNT9Mz8g@mail.gmail.com>

+cc paul for any further/RCU insights.

On 7/27/26 12:03 AM, Jirka Hladky wrote:
>    Hi Shrikanth, Christophe,
> 

Hi Jirka, thanks for the report.

>   I'm seeing a significant performance regression on ppc64le after this
>   patch landed in 6.16, caused by CONFIG_PREEMPT_RCU becoming active
>   once HAVE_PREEMPT_DYNAMIC_KEY is selected.
> 

This is true only if user selected PREEMPT_DYNAMIC option i think.

config PREEMPT_RCU
         bool
         default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC)
         select TREE_RCU


>   Benchmark: stress-ng kill stressor (tight kill() syscall loop),
>   single thread, POWER10 LPAR (8 vCPUs, 1 core SMT-8).
> 
>   Bisected across Fedora ELN kernel builds on ppc64le:
> 
>     kernel               CONFIG_PREEMPT_RCU   kill bogo-ops/sec
>   ---  6.15-rc6 (eln148)    no                   103,207
>     6.16     (eln150)          yes                   70,281    (-32%)
>     6.18     (eln154)          yes                   72,552    (-30%)
> 

Does your preemption mode remain the same in two cases?

>   For comparison, x86_64 (AMD EPYC 9355P) with the same config change
>   shows only a 2.8% regression:
> 
>     6.12 x86_64          37,436
>     7.2  x86_64           36,392    (-2.8%)
> 
>   perf report shows the overhead comes from rcu_read_lock/unlock in the
>   SELinux AVC path (check_kill_permission -> security_task_kill ->
>   selinux_task_kill -> avc_has_perm -> avc_lookup):
> 
>     Function               6.15 (no PREEMPT_RCU)   6.16 (PREEMPT_RCU)
>   ---  avc_lookup                          15.23%              24.79%
>     __rcu_read_lock                      ~0%                 4.52%
>     __rcu_read_unlock                    ~0%                 4.17%
>     selinux_task_kill                    6.23%               7.35%
>     audit_signal_info*                   0.94%               3.59%
> 
>   On x86_64, rcu_read_lock/unlock are cheap thanks to static calls
>   (HAVE_PREEMPT_DYNAMIC_CALL). On ppc64le with the KEY-based
>   implementation, the weak memory model requires real barriers
>   (lwsync/isync) making each RCU read-side critical section
>   significantly more expensive.

Weak memory model would need barriers irrespective of HAVE_PREEMPT_DYNAMIC_CALL
or HAVE_PREEMPT_DYNAMIC_KEY. That's my assumption. I will look
more into it. Also i don't know much about PREEMPT_RCU. So might take a while.

> 
>   This aligns with Christophe's earlier review comment that
>   HAVE_PREEMPT_DYNAMIC_CALL should be more performant. Would
>   implementing static calls for ppc64 be feasible to close this gap?
> 

Static key too is expected to minimal cost. There maybe more into this.

>   Test details:
>   - Machine: IBM POWER10 (pvr 0080 0200), pHyp virtualization
>   - stress-ng 0.21.03, gcc 14.3.1, glibc 2.39
>   - Tuned profile: virtual-guest
>   - SELinux: enforcing (permissive recovers only ~7%)
> 
>   Happy to run additional tests if needed.
> 
> 


  reply	other threads:[~2026-07-27  4:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 18:43 [PATCH v4 0/1] powerpc: Enable dynamic preemption Shrikanth Hegde
2025-02-10 18:43 ` [PATCH v4 1/1] powerpc: enable " Shrikanth Hegde
2026-07-26 18:33   ` Jirka Hladky
2026-07-27  4:18     ` Shrikanth Hegde [this message]
2026-07-27 10:13       ` Jirka Hladky
2026-07-27 10:28         ` Shrikanth Hegde
2026-07-27 10:35           ` Christophe Leroy (CS GROUP)
2026-07-27 16:12             ` Paul E. McKenney
2026-07-27 10:59           ` Jirka Hladky
2026-07-27 11:03             ` Shrikanth Hegde
2026-07-27 12:34         ` Shrikanth Hegde
2026-07-27 16:07       ` Paul E. McKenney
2026-07-27 16:50         ` Jirka Hladky
2026-07-27 17:10           ` Shrikanth Hegde
2026-07-27 18:29             ` Christophe Leroy (CS GROUP)
2026-07-28  5:27               ` Shrikanth Hegde
2026-07-28  0:26             ` Jirka Hladky
2026-07-28  5:11               ` Shrikanth Hegde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0f51eda-21c4-4e9d-95e9-75b2740c3f43@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=bigeasy@linutronix.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=jhladky@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox