Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1251356
| From | Boqun Feng <boqun.feng@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation |
| Date | 2015-10-20 09:40 +0200 |
| Message-ID | <qlzGy-5pm-39@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <qhreB-7rq-87@gated-at.bofh.it> <qhBnz-5g1-1@gated-at.bofh.it> <qhCtk-6Ne-25@gated-at.bofh.it> <ql7hf-5TU-7@gated-at.bofh.it> <qlfRv-1wY-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Mon, Oct 19, 2015 at 12:23:24PM +0200, Peter Zijlstra wrote:
> On Mon, Oct 19, 2015 at 09:17:18AM +0800, Boqun Feng wrote:
> > This is confusing me right now. ;-)
> >
> > Let's use a simple example for only one primitive, as I understand it,
> > if we say a primitive A is "fully ordered", we actually mean:
> >
> > 1. The memory operations preceding(in program order) A can't be
> > reordered after the memory operations following(in PO) A.
> >
> > and
> >
> > 2. The memory operation(s) in A can't be reordered before the
> > memory operations preceding(in PO) A and after the memory
> > operations following(in PO) A.
> >
> > If we say A is a "full barrier", we actually means:
> >
> > 1. The memory operations preceding(in program order) A can't be
> > reordered after the memory operations following(in PO) A.
> >
> > and
> >
> > 2. The memory ordering guarantee in #1 is visible globally.
> >
> > Is that correct? Or "full barrier" is more strong than I understand,
> > i.e. there is a third property of "full barrier":
> >
> > 3. The memory operation(s) in A can't be reordered before the
> > memory operations preceding(in PO) A and after the memory
> > operations following(in PO) A.
> >
> > IOW, is "full barrier" a more strong version of "fully ordered" or not?
>
> Yes, that was how I used it.
>
> Now of course; the big question is do we want to promote this usage or
> come up with a different set of words describing this stuff.
>
> I think separating the ordering from the transitivity is useful, for we
> can then talk about and specify them independently.
>
Great idea!
> That is, we can say:
>
> LOAD-ACQUIRE: orders LOAD->{LOAD,STORE}
> weak transitivity (RCpc)
>
> MB: orders {LOAD,STORE}->{LOAD,STORE} (fully ordered)
> strong transitivity (RCsc)
>
It will be helpful if we have this kind of description for each
primitive mentioned in memory-barriers.txt, which, IMO, is better than
the description like the following:
"""
Any atomic operation that modifies some state in memory and returns information
about the state (old or new) implies an SMP-conditional general memory barrier
(smp_mb()) on each side of the actual operation (with the exception of
"""
I'm assuming that the arrow "->" stands for the program order, and word
"orders" means that a primitive guarantees some program order becomes
the memory operation order, so that the description above can be
rewritten as:
value-returning atomics:
orders {LOAD,STORE}->RmW(atomic operation)->{LOAD,STORE}
strong transitivity
much simpler and clearer for discussion and reasoning
Regards,
Boqun
> etc..
>
> Also, in the above I used weak and strong transitivity, but that too is
> of course up for grabs.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Boqun Feng <boqun.feng@gmail.com> - 2015-10-19 03:20 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Peter Zijlstra <peterz@infradead.org> - 2015-10-19 12:30 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Boqun Feng <boqun.feng@gmail.com> - 2015-10-20 09:40 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-21 01:40 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Peter Zijlstra <peterz@infradead.org> - 2015-10-21 10:30 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-21 21:30 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation Peter Zijlstra <peterz@infradead.org> - 2015-10-21 21:40 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-21 22:00 +0200
RE: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation David Laight <David.Laight@ACULAB.COM> - 2015-10-21 18:10 +0200
Re: [PATCH v2] barriers: introduce smp_mb__release_acquire and update documentation "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-10-21 21:40 +0200
csiph-web