Re: [PATCH v5 0/8] Generic IRQ entry/exit support for powerpc

Jirka Hladky <[email protected]>
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kernel.vger.linux-kernel
Message-ID <CAE4VaGACd2es4NPQyhbR9pMEoGiTVBSE7Lw7x9VOb1Qbpvc6nw@mail.gmail.com>
Hi Mukesh, Shrikanth, Madhavan,

I'm seeing a ~19% throughput regression on ppc64le (POWER10) in
syscall-heavy workloads between kernel 7.1 and 7.2-rc4, which I've
narrowed down to the GENERIC_ENTRY enablement for powerpc (commit
bee25f97ad24 "powerpc: Enable GENERIC_ENTRY feature").

The regression manifests specifically when SELinux is enabled. Regression
disappears with selinux=0. With SELinux disabled, 7.2 is actually
slightly *faster* than 7.1.

Test: stress-ng --kill 1 -t 23 (single-thread kill() syscall loop)
Machine: IBM,9080-HEX POWER10, 8 vCPUs (1 core SMT-8), 64 GiB

Results (bogo-ops/sec, higher is better):

Kernel   Enforcing   Permissive   Disabled    SELinux tax
------   ---------   ----------   --------    -----------
7.1      69,107      70,248       93,566      -26.1%
7.2-rc4  56,247      59,075       99,240      -43.3%
Delta    -18.6%      -15.9%       +6.1%

Key observations:
- SELinux permissive ~ enforcing on both kernels (overhead is in the
  code path, not policy evaluation)
- SELinux disabled: 7.2 is 6% faster than 7.1 -- the generic entry
  path itself is not slower for the base syscall
- The SELinux "tax" nearly doubles from 26% to 43% between 7.1->7.2
- No changes to security/selinux/avc.c between v7.1 and v7.2-rc4

The kill() hot path (sys_kill -> check_kill_permission -> security_task_kill
-> selinux_task_kill -> avc_has_perm -> avc_lookup) wraps every AVC lookup
in rcu_read_lock()/rcu_read_unlock(). On ppc64le with PREEMPT_RCU, each
pair requires lwsync/isync barriers. I suspect the generic entry path
changes something in how context tracking, tracing, or RCU interacts
with the syscall fast path that amplifies the per-call RCU cost.

Note: this is on top of a separate ~36% regression from 6.12->7.1 caused
by HAVE_PREEMPT_DYNAMIC_KEY enabling CONFIG_PREEMPT_RCU on ppc64le
(commit 6ad7751537e8), which I reported separately on the v4 thread.

Thank you
Jirka

On Mon, Apr 27, 2026 at 2:33 PM Mukesh Kumar Chaurasiya (IBM)
<[email protected]> wrote:
>
> Adding support for the generic irq entry/exit handling for PowerPC. The
> goal is to bring PowerPC in line with other architectures that already
> use the common irq entry infrastructure, reducing duplicated code and
> making it easier to share future changes in entry/exit paths.
>
> This is slightly tested of ppc64le and ppc32.
>
> The performance benchmarks are below:
>
> perf bench syscall usec/op (-ve is improvement)
>
> | Syscall | Base        | test        | change % |
> | ------- | ----------- | ----------- | -------- |
> | basic   | 0.093543    | 0.093023    | -0.56    |
> | execve  | 446.557781  | 450.107172  | +0.79    |
> | fork    | 1142.204391 | 1156.377214 | +1.24    |
> | getpgid | 0.097666    | 0.092677    | -5.11    |
>
> perf bench syscall ops/sec (+ve is improvement)
>
> | Syscall | Base     | New      | change % |
> | ------- | -------- | -------- | -------- |
> | basic   | 10690548 | 10750140 | +0.56    |
> | execve  | 2239     | 2221     | -0.80    |
> | fork    | 875      | 864      | -1.26    |
> | getpgid | 10239026 | 10790324 | +5.38    |
>
>
> IPI latency benchmark (-ve is improvement)
>
> | Metric         | Base (ns)     | New (ns)      | % Change |
> | -------------- | ------------- | ------------- | -------- |
> | Dry run        | 583136.56     | 584136.35     | 0.17%    |
> | Self IPI       | 4167393.42    | 4149093.90    | -0.44%   |
> | Normal IPI     | 61769347.82   | 61753728.39   | -0.03%   |
> | Broadcast IPI  | 2235584825.02 | 2227521401.45 | -0.36%   |
> | Broadcast lock | 2164964433.31 | 2125658641.76 | -1.82%   |
>
>
> Thats very close to performance earlier with arch specific handling.
>
> Tests done:
>  - Build and boot on ppc64le pseries.
>  - Build and boot on ppc64le powernv8 powernv9 powernv10.
>  - Build and boot on ppc32.
>  - Performance benchmark done with perf syscall basic on pseries.
>
> Changelog:
> V4 -> V5:
>  - Rebased on latest mainline
> V4: https://lore.kernel.org/all/[email protected]/
>
> V3 -> V4:
>  - Fixed the issue in older gcc version where linker couldn't find
>    mem functions
>  - Merged IRQ enable and syscall enable into a single patch
>  - Cleanup for unused functions done in separate patch.
>  - Some other cosmetic changes
> V3: https://lore.kernel.org/all/[email protected]/
>
> V2 -> V3:
>  - #ifdef CONFIG_GENERIC_IRQ_ENTRY removed from unnecessary places
>  - Some functions made __always_inline
>  - pt_regs padding changed to match 16byte interrupt stack alignment
>  - And some cosmetic changes from reviews from earlier patch
> V2: https://lore.kernel.org/all/[email protected]/
>
> V1 -> V2:
>  - Fix an issue where context tracking was showing warnings for
>    incorrect context
> V1: https://lore.kernel.org/all/[email protected]/
>
> RFC -> PATCH V1:
>  - Fix for ppc32 spitting out kuap lock warnings.
>  - ppc64le powernv8 crash fix.
>  - Review comments incorporated from previous RFC.
> RFC https://lore.kernel.org/all/[email protected]/
>
> Mukesh Kumar Chaurasiya (8):
>   powerpc: rename arch_irq_disabled_regs
>   powerpc: Prepare to build with generic entry/exit framework
>   powerpc: introduce arch_enter_from_user_mode
>   powerpc: Introduce syscall exit arch functions
>   powerpc: add exit_flags field in pt_regs
>   powerpc: Prepare for IRQ entry exit
>   powerpc: Enable GENERIC_ENTRY feature
>   powerpc: Remove unused functions
>
>  arch/powerpc/Kconfig                    |   1 +
>  arch/powerpc/include/asm/entry-common.h | 533 ++++++++++++++++++++++++
>  arch/powerpc/include/asm/hw_irq.h       |   4 +-
>  arch/powerpc/include/asm/interrupt.h    | 386 +++--------------
>  arch/powerpc/include/asm/kasan.h        |  15 +-
>  arch/powerpc/include/asm/ptrace.h       |   6 +-
>  arch/powerpc/include/asm/signal.h       |   1 -
>  arch/powerpc/include/asm/stacktrace.h   |   6 +
>  arch/powerpc/include/asm/syscall.h      |   5 +
>  arch/powerpc/include/asm/thread_info.h  |   1 +
>  arch/powerpc/include/uapi/asm/ptrace.h  |  14 +-
>  arch/powerpc/kernel/interrupt.c         | 254 ++---------
>  arch/powerpc/kernel/ptrace/ptrace.c     | 142 +------
>  arch/powerpc/kernel/signal.c            |  25 +-
>  arch/powerpc/kernel/syscall.c           | 119 +-----
>  arch/powerpc/kernel/traps.c             |   2 +-
>  arch/powerpc/kernel/watchdog.c          |   2 +-
>  arch/powerpc/perf/core-book3s.c         |   2 +-
>  18 files changed, 690 insertions(+), 828 deletions(-)
>  create mode 100644 arch/powerpc/include/asm/entry-common.h
>
> --
> 2.53.0
>
>


-- 
-Jirka
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.