Skip to content

x86: speedup local_irq_save() for clang

Eric Dumazet lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2clang: work around asm output constraint problemsinclude/linux/compiler-clang.h include/linux/compiler_types.h+12 -12 replies
2/2x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()arch/x86/include/asm/irqflags.h+0 -07 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] x86: speedup local_irq_save() for clang

clang generates poor code for local_irq_save() callers, because of asm "=rm" output constraint being mishandled.

Frst patch adds ASM_OUTPUT_RM macro, extending ASM_INPUT_RM that Linus added in linux-6.10. Suggested by Uros Bizjak.

Second patch uses it in local_irq_save(), to not penalize gcc while forcing clang to generate better code especially when CONFIG_STACKPROTECTOR_STRONG=y.

smap_save() could also use it, but is not in any fast path.

Eric Dumazet (2):
clang: work around asm output constraint problems x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl()

 arch/x86/include/asm/irqflags.h | 2 +-
 include/linux/compiler-clang.h  | 7 +++++++
 include/linux/compiler_types.h  | 6 +++++-
 3 files changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
2.52.0.322.g1dd061c0dc-goog