Use READ_ONCE() and WRITE_ONCE in count_stat_eventual.c
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 19 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | count_stat_eventual: Switch from ACCESS_ONCE() to READ_ONCE()/WRITE_ONCE()CodeSamples/ | +4 | 14 replies | |
| 2/2 | count_stat_eventual: Add READ_ONCE() to protect global shared variable stopflagCodeSamples/ | +6 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] Use READ_ONCE() and WRITE_ONCE in count_stat_eventual.c
Hi Paul,
Please check the updated patch. The first patch is to replace existing ACCESS_ONCE to new READ/WRITE_ONCE primitives, and the second to protect global share variable stopflag.
BTW, I didn't see any performance differences between versions using volatile and READ/WRITE_ONCE primitives on my 16 cores Intel machine. I guess the major reason is that the sample code is simple such that registers are enough even if keyword volatile is used.
Junchang Wang (2):
count_stat_eventual: Switch from ACCESS_ONCE() to
READ_ONCE()/WRITE_ONCE()
count_stat_eventual: Add READ_ONCE() to protect global shared variable
stopflag
CodeSamples/count/count_stat_eventual.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
Signature · 1 line
2.7.4