public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] csky: Optimize with acquire & release for atomic & cmpxchg
@ 2022-04-11 14:51 guoren
  2022-04-11 14:51 ` [PATCH V2 1/2] csky: cmpxchg: Optimize with acquire & release guoren
  2022-04-11 14:51 ` [PATCH V2 2/2] csky: atomic: Add custom atomic.h implementation guoren
  0 siblings, 2 replies; 4+ messages in thread
From: guoren @ 2022-04-11 14:51 UTC (permalink / raw)
  To: guoren, arnd, mark.rutland; +Cc: linux-arch, linux-kernel, linux-csky, Guo Ren

From: Guo Ren <guoren@linux.alibaba.com>

Optimize arch_xchg|cmpxchg|cmpxchg_local with ASM acquire|release
instructions instead of previous C based.

The generic atomic.h used cmpxchg to implement the atomic
operations, it will cause daul loop to reduce the forward
guarantee. The patch implement csky custom atomic operations with
ldex/stex instructions for the best performance.

Important reference comment by Rutland:
8e86f0b409a4 ("arm64: atomics: fix use of acquire + release for
full barrier semantics")

Changes in V2:
 - Fixup use of acquire + release for barrier semantics by Rutland.

Guo Ren (2):
  csky: cmpxchg: Optimize with acquire & release
  csky: atomic: Add custom atomic.h implementation

 arch/csky/include/asm/atomic.h  | 130 ++++++++++++++++++++++++++++++++
 arch/csky/include/asm/barrier.h |   8 +-
 arch/csky/include/asm/cmpxchg.h |  61 +++++++++++++--
 3 files changed, 190 insertions(+), 9 deletions(-)
 create mode 100644 arch/csky/include/asm/atomic.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-12  5:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 14:51 [PATCH V2 0/2] csky: Optimize with acquire & release for atomic & cmpxchg guoren
2022-04-11 14:51 ` [PATCH V2 1/2] csky: cmpxchg: Optimize with acquire & release guoren
2022-04-11 14:51 ` [PATCH V2 2/2] csky: atomic: Add custom atomic.h implementation guoren
2022-04-12  5:21   ` Guo Ren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox