All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4 0/3] csky: Optimize atomic_ops & cmpxchg
@ 2022-04-24  7:29 guoren
  2022-04-24  7:29 ` [PATCH V4 1/3] csky: atomic: Optimize cmpxchg with acquire & release guoren
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: guoren @ 2022-04-24  7:29 UTC (permalink / raw)
  To: guoren, arnd, mark.rutland, boqun.feng, peterz, will
  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.

Changes in V4:
 - Remove RELEASE_FENCE in ldex/stex loop by Buoqun's advice

Changes in V3:
 - Add arch_atomic_(fetch_add_unless, inc_unless_negative,
   dec_unless_positive, dec_if_positive)

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

Guo Ren (3):
  csky: atomic: Optimize cmpxchg with acquire & release
  csky: atomic: Add custom atomic.h implementation
  csky: atomic: Add conditional atomic operations' optimization

 arch/csky/include/asm/atomic.h  | 237 ++++++++++++++++++++++++++++++++
 arch/csky/include/asm/barrier.h |  11 +-
 arch/csky/include/asm/cmpxchg.h |  64 ++++++++-
 3 files changed, 304 insertions(+), 8 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-24  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  7:29 [PATCH V4 0/3] csky: Optimize atomic_ops & cmpxchg guoren
2022-04-24  7:29 ` [PATCH V4 1/3] csky: atomic: Optimize cmpxchg with acquire & release guoren
2022-04-24  7:29 ` [PATCH V4 2/3] csky: atomic: Add custom atomic.h implementation guoren
2022-04-24  7:29 ` [PATCH V4 3/3] csky: atomic: Add conditional atomic operations' optimization guoren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.