RFC implement atomic_fetch_$op
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest31 patches 34 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/31 | locking: Flip arguments to atomic_fetch_orinclude/ kernel/ | +4 | 3 replies | |
| 2/31 | locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()arch/ | +58 | 2 replies | |
| 3/31 | locking,arc: Implement atomic_fetch_{add,sub,and,andnot,or,xor}()arch/ | +64 | 4 replies | |
| 4/31 | locking,arm: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()arch/ | +98 | 1 reply | |
| 5/31 | locking,arm64: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()arch/ arch/ | +116 | 2 replies | |
| 6/31 | locking,avr32: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +51 | 1 reply | |
| 7/31 | locking,blackfin: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ | +40 | 0 replies | |
| 8/31 | locking,frv: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ arch/ | +14 | 0 replies | |
| 9/31 | locking,h8300: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +25 | 0 replies | |
| 10/31 | locking,hexagon: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +28 | 2 replies | |
| 11/31 | locking,ia64: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ | +116 | 0 replies | |
| 12/31 | locking,m32r: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +34 | 0 replies | |
| 13/31 | locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +49 | 0 replies | |
| 14/31 | locking,metag: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ | +63 | 2 replies | |
| 15/31 | locking,mips: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ | +129 | 0 replies | |
| 16/31 | locking,mn10300: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +31 | 0 replies | |
| 17/31 | locking,parisc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ | +57 | 0 replies | |
| 18/31 | locking,powerpc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}{,_relaxed,_acquire,_release}()arch/ | +74 | 2 replies | |
| 19/31 | locking,s390: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ | +32 | 2 replies | |
| 20/31 | locking,sh: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ +1 more | +87 | 0 replies | |
| 21/31 | locking,sparc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ +3 more | +105 | 0 replies | |
| 22/31 | locking,tile: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ +3 more | +161 | 4 replies | |
| 23/31 | locking,x86: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()arch/ arch/ arch/ | +88 | 0 replies | |
| 24/31 | locking,xtensa: Implement atomic_fetch_{add,sub,and,or,xor}()arch/ | +50 | 0 replies | |
| 25/31 | locking: Fix atomic64_relaxed bitsinclude/ | +153 | 0 replies | |
| 26/31 | locking: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()include/ include/ include/ +3 more | +493 | 0 replies | |
| 27/31 | locking: Remove linux/atomic.h:atomic_fetch_orarch/ arch/ arch/ +20 more | +0 | 2 replies | |
| 28/31 | locking: Remove the deprecated atomic_{set,clear}_mask() functionsinclude/ kernel/ | +2 | 0 replies | |
| 29/31 | locking,alpha: Convert to _relaxed atomicsarch/ | +24 | 0 replies | |
| 30/31 | locking,mips: Convert to _relaxed atomicsarch/ | +22 | 0 replies | |
| 31/31 | locking,qrwlock: Employ atomic_fetch_add_acquire()kernel/ | +1 | 1 reply |
Reviews trailers per patch
9 of 31 patches have a Reviewed-by or Acked-by.
| Patch | Will Deacon | Hans-Christian Noren Egtvedt | Waiman Long | Vineet Gupta | Martin Schwidefsky | Chris Metcalf | Richard Kuo | James Hogan |
|---|---|---|---|---|---|---|---|---|
| 1/31 | A-b | |||||||
| 2/31 | ||||||||
| 3/31 | A-b | |||||||
| 4/31 | A-b | |||||||
| 5/31 | ||||||||
| 6/31 | A-b | |||||||
| 7/31 | ||||||||
| 8/31 | ||||||||
| 9/31 | ||||||||
| 10/31 | A-b | |||||||
| 11/31 | ||||||||
| 12/31 | ||||||||
| 13/31 | ||||||||
| 14/31 | A-b | |||||||
| 15/31 | ||||||||
| 16/31 | ||||||||
| 17/31 | ||||||||
| 18/31 | ||||||||
| 19/31 | A-b | |||||||
| 20/31 | ||||||||
| 21/31 | ||||||||
| 22/31 | A-b | |||||||
| 23/31 | ||||||||
| 24/31 | ||||||||
| 25/31 | ||||||||
| 26/31 | ||||||||
| 27/31 | ||||||||
| 28/31 | ||||||||
| 29/31 | ||||||||
| 30/31 | ||||||||
| 31/31 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.
Cover letter [RFC][PATCH 00/31] implement atomic_fetch_$op
As there have been a few requests for atomic_fetch_$op primitives and recently by Linus, I figured I'd go and implement the lot.
The atomic_fetch_$op differs from the existing atomic_$op_return we already have by returning the old value instead of the new value. This is especially useful when the operation is irreversible (like bitops), and allows for things like test-and-set.
I did these patches on the plane, without access to architecture documentation, so mistakes are quite possible. However, I mostly started with the atomic_$op_return implementation and modified those to return the old value, which significantly decreases the creativity required.
The one that I did not do was ARMv8.1-LSE and I was hoping Will would help out with that. Also, it looks like the 0-day built bot does not do arm64 builds, people might want to look into that.
No known build breakage on the build-bot, boot tested on x86_64.
Notes:
- tile might have a barrier issue
- there are a few more archs that can be converted to _relaxed if they so care:
arc metag tile
--- arch/alpha/include/asm/atomic.h | 89 ++++- arch/arc/include/asm/atomic.h | 67 +++- arch/arm/include/asm/atomic.h | 106 +++++- arch/arm64/include/asm/atomic.h | 30 ++ arch/arm64/include/asm/atomic_ll_sc.h | 108 ++++-- arch/avr32/include/asm/atomic.h | 54 ++- arch/blackfin/include/asm/atomic.h | 8 + arch/blackfin/kernel/bfin_ksyms.c | 1 + arch/blackfin/mach-bf561/atomic.S | 43 ++- arch/frv/include/asm/atomic.h | 30 +- arch/frv/include/asm/atomic_defs.h | 2 + arch/h8300/include/asm/atomic.h | 29 +- arch/hexagon/include/asm/atomic.h | 31 +- arch/ia64/include/asm/atomic.h | 130 ++++++- arch/m32r/include/asm/atomic.h | 36 +- arch/m68k/include/asm/atomic.h | 51 ++- arch/metag/include/asm/atomic_lnkget.h | 36 +- arch/metag/include/asm/atomic_lock1.h | 33 +- arch/mips/include/asm/atomic.h | 154 +++++++- arch/mn10300/include/asm/atomic.h | 33 +- arch/parisc/include/asm/atomic.h | 63 +++- arch/powerpc/include/asm/atomic.h | 83 ++++- arch/s390/include/asm/atomic.h | 40 ++- arch/sh/include/asm/atomic-grb.h | 34 +- arch/sh/include/asm/atomic-irq.h | 31 +- arch/sh/include/asm/atomic-llsc.h | 32 +- arch/sparc/include/asm/atomic_32.h | 13 +- arch/sparc/include/asm/atomic_64.h | 16 +- arch/sparc/lib/atomic32.c | 29 +- arch/sparc/lib/atomic_64.S | 61 +++- arch/sparc/lib/ksyms.c | 17 +- arch/tile/include/asm/atomic.h | 2 + arch/tile/include/asm/atomic_32.h | 60 +++- arch/tile/include/asm/atomic_64.h | 117 ++++-- arch/tile/include/asm/bitops_32.h | 18 +- arch/tile/lib/atomic_32.c | 42 +-- arch/tile/lib/atomic_asm_32.S | 14 +- arch/x86/include/asm/atomic.h | 35 +- arch/x86/include/asm/atomic64_32.h | 25 +- arch/x86/include/asm/atomic64_64.h | 35 +- arch/xtensa/include/asm/atomic.h | 52 ++- include/asm-generic/atomic-long.h | 36 +- include/asm-generic/atomic.h | 47 +++ include/asm-generic/atomic64.h | 15 +- include/linux/atomic.h | 627 ++++++++++++++++++++++++--------- kernel/locking/qrwlock.c | 2 +- kernel/locking/qspinlock_paravirt.h | 4 +- kernel/time/tick-sched.c | 4 +- lib/atomic64.c | 32 +- lib/atomic64_test.c | 34 ++ 50 files changed, 2181 insertions(+), 510 deletions(-)