Skip to content

riscv: Optimize atomic implementation

[email protected] linux-arch linux-riscv lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 18 repliesIn review
  2. v35 patches 1 replySuperseded
  3. v23 patches 17 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch0 repliesSuperseded

Changes in v4 from the cover letter

- Coding convention & optimize the comments
- Re-order the patchset

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5riscv: atomic: Cleanup unnecessary definitionarch/riscv/include/asm/cmpxchg.h+0 -120 replies
2/5riscv: atomic: Optimize dec_if_positive functionsarch/riscv/include/asm/atomic.h+10 -100 replies
3/5riscv: atomic: Add custom conditional atomic operation implementationarch/riscv/include/asm/atomic.h+82 -00 replies
4/5riscv: atomic: Optimize atomic_ops & xchg with .aq/rl annotationarch/riscv/include/asm/atomic.h arch/riscv/include/asm/cmpxchg.h+68 -80 replies
5/5riscv: atomic: Optimize LRSC-pairs atomic ops with .aqrl annotationarch/riscv/include/asm/atomic.h arch/riscv/include/asm/cmpxchg.h+10 -2018 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH V4 0/5] riscv: Optimize atomic implementation

From: Guo Ren <[email protected]>

Here are some optimizations for riscv atomic implementation, the first three patches are normal cleanup and custom implementation without relating to atomic semantics.

The 4th is the same as arm64 LSE with using embedded .aq/.rl annotation.

The 5th is good for riscv implementation with reducing a full-barrier cost.

Changes in V4:
- Coding convention & optimize the comments
- Re-order the patchset

Changes in V3:
- Fixup usage of lr.rl & sc.aq with violation of ISA
- Add Optimize dec_if_positive functions
- Add conditional atomic operations' optimization

Changes in V2:
- Fixup LR/SC memory barrier semantic problems which pointed by Rutland
- Combine patches into one patchset series
- Separate AMO optimization & LRSC optimization for convenience patch review

Guo Ren (5):
riscv: atomic: Cleanup unnecessary definition
riscv: atomic: Optimize acquire and release for AMO operations
riscv: atomic: Optimize memory barrier semantics of LRSC-pairs
riscv: atomic: Optimize dec_if_positive functions
riscv: atomic: Add conditional atomic operations' optimization

Guo Ren (5):
riscv: atomic: Cleanup unnecessary definition
riscv: atomic: Optimize dec_if_positive functions
riscv: atomic: Add custom conditional atomic operation implementation
riscv: atomic: Optimize atomic_ops & xchg with .aq/rl annotation
riscv: atomic: Optimize LRSC-pairs atomic ops with .aqrl annotation

 arch/riscv/include/asm/atomic.h  | 174 +++++++++++++++++++++++++++----
 arch/riscv/include/asm/cmpxchg.h |  30 ++----
 2 files changed, 162 insertions(+), 42 deletions(-)
Signature · 1 line
2.25.1