linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 0/7] atomics: powerpc: Implement relaxed/acquire/release variants of some atomics
@ 2015-09-16 15:49 Boqun Feng
  2015-09-16 15:49 ` [RFC v2 1/7] atomics: Add test for atomic operations with _relaxed variants Boqun Feng
                   ` (6 more replies)
  0 siblings, 7 replies; 42+ messages in thread
From: Boqun Feng @ 2015-09-16 15:49 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: Peter Zijlstra, Ingo Molnar, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Thomas Gleixner, Will Deacon,
	Paul E. McKenney, Waiman Long, Boqun Feng


Link for v1: https://lkml.org/lkml/2015/8/27/798

Changes since v1:

*	avoid to introduce macro arch_atomic_op_*()

*	also fix the problem that cmpxchg, xchg and their atomic_
	versions are not full barriers in PPC implementation.

*	rebase on v4.3-rc1


Relaxed/acquire/release variants of atomic operations {add,sub}_return
and {cmp,}xchg are introduced by commit:

"atomics: add acquire/release/relaxed variants of some atomic operations"

By default, the generic code will implement a relaxed variant as a full
ordered atomic operation and release/acquire a variant as a relaxed
variant with a necessary general barrier before or after.

On powerpc, which has a weak memory order model, a relaxed variant can
be implemented more lightweightly than a full ordered one. Further more,
release and acquire variants can be implemented with arch-specific
lightweight barriers.

Besides, cmpxchg, xchg and their atomic_ versions are only RELEASE+ACQUIRE
rather that full barriers in current PPC implementation, which is incorrect
according to memory-barriers.txt.

Therefore this patchset implements the relaxed/acquire/release variants
based on powerpc memory model and specific barriers, and fix cmpxchg,
xchg and their atomic_ versions. A trivial test for these new variants
is also included in this series, because some of these variants are not
used in kernel for now, I think is a good idea to at least generate the
code for these variants somewhere.

The patchset consists of 7 parts:

1.	Add trivial tests for the new variants in lib/atomic64_test.c

2.	Allow architectures to define their own __atomic_op_*() helpers
	to build other variants based on relaxed.

3.	Implement atomic{,64}_{add,sub}_return_* variants

4.	Implement xchg_* and atomic{,64}_xchg_* variants

5.	Implement cmpxchg_* atomic{,64}_cmpxchg_* variants

6.	Make atomic{,64}_xchg and xchg full barriers

7.	Make atomic{,64}_cmpxchg and cmpxchg full barriers

This patchset is based on v4.3-rc1 and all patches are built and boot
tested for little endian powernv and pseries, and also tested by 0day.


Looking forward to any suggestion, question and comment ;-)

Regards,
Boqun


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

end of thread, other threads:[~2015-10-12 23:24 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 15:49 [RFC v2 0/7] atomics: powerpc: Implement relaxed/acquire/release variants of some atomics Boqun Feng
2015-09-16 15:49 ` [RFC v2 1/7] atomics: Add test for atomic operations with _relaxed variants Boqun Feng
2015-10-12  9:30   ` Will Deacon
2015-10-12  9:38     ` Boqun Feng
2015-09-16 15:49 ` [RFC v2 2/7] atomics: Allow architectures to define their own __atomic_op_* helpers Boqun Feng
2015-09-16 15:49 ` [RFC v2 3/7] powerpc: atomic: Implement atomic{,64}_{add,sub}_return_* variants Boqun Feng
2015-09-18 16:59   ` Will Deacon
2015-09-19 15:33     ` Boqun Feng
2015-09-20  8:23       ` Boqun Feng
2015-09-21 22:24         ` Will Deacon
2015-09-21 23:26           ` Boqun Feng
2015-09-21 23:37             ` Boqun Feng
2015-09-22 15:25               ` Paul E. McKenney
2015-09-23  0:07                 ` Boqun Feng
2015-09-25 21:29                   ` Paul E. McKenney
2015-09-26  2:18                     ` Boqun Feng
2015-09-16 15:49 ` [RFC v2 4/7] powerpc: atomic: Implement xchg_* and atomic{,64}_xchg_* variants Boqun Feng
2015-10-01 12:24   ` Peter Zijlstra
2015-10-01 15:09     ` Paul E. McKenney
2015-10-01 17:13       ` Peter Zijlstra
2015-10-01 18:03         ` Paul E. McKenney
2015-10-01 18:23           ` Peter Zijlstra
2015-10-01 19:41             ` Paul E. McKenney
2015-10-05 14:44           ` Will Deacon
2015-10-05 16:57             ` Paul E. McKenney
2015-10-12  1:17           ` Boqun Feng
2015-10-12  9:28             ` Will Deacon
2015-10-12 23:24             ` Paul E. McKenney
2015-09-16 15:49 ` [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants Boqun Feng
2015-10-01 12:27   ` Peter Zijlstra
2015-10-01 12:36     ` Peter Zijlstra
2015-10-01 15:12       ` Paul E. McKenney
2015-10-01 17:11         ` Peter Zijlstra
2015-10-01 15:13       ` Paul E. McKenney
2015-10-10  1:58     ` Boqun Feng
2015-10-11 10:25       ` Boqun Feng
2015-10-12  6:46         ` Peter Zijlstra
2015-10-12  7:03           ` Boqun Feng
2015-09-16 15:49 ` [RFC v2 6/7] powerpc: atomic: Make atomic{,64}_xchg and xchg a full barrier Boqun Feng
2015-10-01 12:28   ` Peter Zijlstra
     [not found]     ` <CAL0jBu_=w-GDtg6B+YXLmEn=Qac0mnWaWzS6NvLC9KMcNSj8=w@mail.gmail.com>
2015-10-02  5:25       ` Peter Zijlstra
2015-09-16 15:49 ` [RFC v2 7/7] powerpc: atomic: Make atomic{,64}_cmpxchg and cmpxchg " Boqun Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).