make atomic_read() behave consistently across all architectures
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest24 patches 385 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/24 | make atomic_read() behave consistently on alphainclude/ | +11 | 35 replies | |
| 2/24 | make atomic_read() behave consistently on arminclude/ | +6 | 1 reply | |
| 3/24 | make atomic_read() behave consistently on avr32include/ | +6 | 0 replies | |
| 4/24 | make atomic_read() behave consistently on blackfininclude/ | +5 | 0 replies | |
| 5/24 | make atomic_read() behave consistently on crisinclude/ | +6 | 0 replies | |
| 6/24 | make atomic_read() behave consistently on frvinclude/ | +6 | 29 replies | |
| 7/24 | make atomic_read() behave consistently on h8300include/ | +5 | 0 replies | |
| 8/24 | make atomic_read() behave consistently on i386include/ | +1 | 0 replies | |
| 9/24 | make atomic_read() behave consistently on ia64include/ | +8 | 13 replies | |
| 10/24 | make atomic_read() behave consistently on m32rinclude/ | +2 | 0 replies | |
| 11/24 | make atomic_read() behave consistently on m68knommuinclude/ | +5 | 0 replies | |
| 12/24 | make atomic_read() behave consistently on m68kinclude/ | +5 | 0 replies | |
| 13/24 | make atomic_read() behave consistently on mipsinclude/ | +4 | 1 reply | |
| 14/24 | make atomic_read() behave consistently on pariscinclude/ | +8 | 1 reply | |
| 15/24 | make atomic_read() behave consistently on powerpcinclude/ | +8 | 0 replies | |
| 16/24 | make atomic_read() behave consistently on s390include/ | +6 | 1 reply | |
| 17/24 | make atomic_read() behave consistently on sh64include/ | +6 | 0 replies | |
| 18/24 | make atomic_read() behave consistently on shinclude/ | +6 | 1 reply | |
| 19/24 | make atomic_read() behave consistently on sparc64include/ | +8 | 0 replies | |
| 20/24 | make atomic_read() behave consistently on sparcinclude/ | +6 | 0 replies | |
| 21/24 | make atomic_read() behave consistently on v850include/ | +5 | 0 replies | |
| 22/24 | make atomic_read() behave consistently on x86_64include/ | +3 | 0 replies | |
| 23/24 | make atomic_read() behave consistently on xtensainclude/ | +2 | 0 replies | |
| 24/24 | document volatile atomic_read() behaviorDocumentation/ | +11 | 7 replies |
Reviews trailers per patch
5 of 24 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Martin Schwidefsky | Russell King | Paul Mundt | Kyle McMartin | Ralf Baechle | Paul E. McKenney | Christoph Lameter |
|---|---|---|---|---|---|---|---|
| Series | A-b | A-b | |||||
| 1/24 | |||||||
| 2/24 | A-b | ||||||
| 3/24 | |||||||
| 4/24 | |||||||
| 5/24 | |||||||
| 6/24 | |||||||
| 7/24 | |||||||
| 8/24 | |||||||
| 9/24 | |||||||
| 10/24 | |||||||
| 11/24 | |||||||
| 12/24 | |||||||
| 13/24 | A-b | ||||||
| 14/24 | A-b | ||||||
| 15/24 | |||||||
| 16/24 | A-b | ||||||
| 17/24 | |||||||
| 18/24 | A-b | ||||||
| 19/24 | |||||||
| 20/24 | |||||||
| 21/24 | |||||||
| 22/24 | |||||||
| 23/24 | |||||||
| 24/24 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.
Cover letter [PATCH 0/24] make atomic_read() behave consistently across all architectures
As recent discussions[1], and bugs[2] have shown, there is a great deal of confusion about the expected behavior of atomic_read(), compounded by the fact that it is not the same on all architectures. Since users expect calls to atomic_read() to actually perform a read, it is not desirable to allow the compiler to optimize this away. Requiring the use of barrier() in this case is inefficient, since we only want to re-load the atomic_t variable, not everything else in scope.
This patchset makes the behavior of atomic_read uniform by removing the volatile keyword from all atomic_t and atomic64_t definitions that currently have it, and instead explicitly casts the variable as volatile in atomic_read(). This leaves little room for creative optimization by the compiler, and is in keeping with the principles behind "volatile considered harmful".
Busy-waiters should still use cpu_relax(), but fast paths may be able to reduce their use of barrier() between some atomic_read() calls.
-- Chris
1) http://lkml.org/lkml/2007/7/1/52
2) http://lkml.org/lkml/2007/8/8/122