Linus Torvalds writes: (Summary) The
write is very much part of it.
write is very much part of it.
Maybe that's what you meant, but it read to me as "just the read part of the rmw behaves as a read-acquire".
of the rmw behaves as a read-acquire".
Because it is very important that the _write_ part of the rmw is also ordered wrt everything that is inside the spinlock. So doing a spinlock as
So doing a spinlock as
(a) read-locked-acquire
modify
(c) write-conditional
(c) write-conditional
would be wrong, because the accesses inside the spinlock are ordered not just wrt the read-acquire, they have to be ordered wrt the write too.
too.
So it is closer to say that it's the _write_ of the r-m-w sequence that has the acquire semantics, not the read.
that has the acquire semantics, not the read.
Yes.
Yes.
Linus
Linus
Linus
write is very much part of it.
Maybe that's what you meant, but it read to me as "just the read part of the rmw behaves as a read-acquire".
of the rmw behaves as a read-acquire".
Because it is very important that the _write_ part of the rmw is also ordered wrt everything that is inside the spinlock. So doing a spinlock as
So doing a spinlock as
(a) read-locked-acquire
modify
(c) write-conditional
(c) write-conditional
would be wrong, because the accesses inside the spinlock are ordered not just wrt the read-acquire, they have to be ordered wrt the write too.
too.
So it is closer to say that it's the _write_ of the r-m-w sequence that has the acquire semantics, not the read.
that has the acquire semantics, not the read.
[...]
- A unlock behaves as a store release.Yes.
Yes.
Linus
Linus
Linus