Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Issue 1246073002: Implement store as an explicit atomic operation. (Closed)

Created:
5 years, 5 months ago by pbos-webrtc
Modified:
5 years, 5 months ago
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), Andrew MacDonald, henrika_webrtc, stefan-webrtc, tterriberry_mozilla.com, mflodman, perkj_webrtc, andresp
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Implement store as an explicit atomic operation. Using explicit atomic operations permits TSan to understand them and prevents false positives. Downgrading the atomic Load to acquire semantics. This reduces the number of memory barriers inserted from two down to one at most. Also renaming Load/Store to AcquireLoad/ReleaseStore. BUG=chromium:512382 R=dvyukov@chromium.org, glider@chromium.org TBR=tommi@webrtc.org Committed: https://crrev.com/235c35f292f8e225a155d98a018e257a7db442c4 Cr-Commit-Position: refs/heads/master@{#9613}

Patch Set 1 #

Patch Set 2 : add tsan versions #

Total comments: 3

Patch Set 3 : gcc/clang builtin atomics #

Total comments: 2

Patch Set 4 : s/Increment/ReleaseStore #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -15 lines) Patch
M webrtc/base/atomicops.h View 1 2 2 chunks +6 lines, -8 lines 0 comments Download
M webrtc/base/refcount.h View 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/system_wrappers/source/trace_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/video/video_capture_input.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (6 generated)
pbos-webrtc
PTAL, (I'm likely to TBR= tommi@ for this).
5 years, 5 months ago (2015-07-21 18:41:56 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1246073002/1
5 years, 5 months ago (2015-07-21 18:42:22 UTC) #4
pbos-webrtc
On 2015/07/21 18:42:22, commit-bot: I haz the power wrote: > Dry run: CQ is trying ...
5 years, 5 months ago (2015-07-21 19:24:31 UTC) #5
pbos-webrtc
add tsan versions
5 years, 5 months ago (2015-07-21 19:39:44 UTC) #6
pbos-webrtc
PTAL
5 years, 5 months ago (2015-07-21 20:14:29 UTC) #7
Alexander Potapenko
As dvyukov@ noticed, it's better to use GCC/Clang __atomic builtins: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html This'll let us have ...
5 years, 5 months ago (2015-07-22 11:12:23 UTC) #9
Alexander Potapenko
(That may require GCC 4.8, so if that's not an option we can stick to ...
5 years, 5 months ago (2015-07-22 11:15:57 UTC) #10
pbos-webrtc
On 2015/07/22 11:15:57, Alexander Potapenko wrote: > (That may require GCC 4.8, so if that's ...
5 years, 5 months ago (2015-07-22 12:49:30 UTC) #11
Alexander Potapenko
https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h File webrtc/base/atomicops.h (right): https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h#newcode59 webrtc/base/atomicops.h:59: static int32_t AcquireLoad(volatile const int32_t* i) { It's better ...
5 years, 5 months ago (2015-07-22 12:57:37 UTC) #12
pbos-webrtc
https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h File webrtc/base/atomicops.h (right): https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h#newcode59 webrtc/base/atomicops.h:59: static int32_t AcquireLoad(volatile const int32_t* i) { On 2015/07/22 ...
5 years, 5 months ago (2015-07-22 13:04:40 UTC) #13
Alexander Potapenko
https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h File webrtc/base/atomicops.h (right): https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h#newcode59 webrtc/base/atomicops.h:59: static int32_t AcquireLoad(volatile const int32_t* i) { On 2015/07/22 ...
5 years, 5 months ago (2015-07-22 13:10:08 UTC) #14
Alexander Potapenko
On 2015/07/22 13:10:08, Alexander Potapenko wrote: > https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h > File webrtc/base/atomicops.h (right): > > https://codereview.webrtc.org/1246073002/diff/20001/webrtc/base/atomicops.h#newcode59 ...
5 years, 5 months ago (2015-07-22 13:11:24 UTC) #15
pbos-webrtc
gcc/clang builtin atomics
5 years, 5 months ago (2015-07-22 13:16:43 UTC) #16
pbos-webrtc
PTAL, we might have to revert it if alarms go sounding off, but it looks ...
5 years, 5 months ago (2015-07-22 13:21:07 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1246073002/40001
5 years, 5 months ago (2015-07-22 13:23:51 UTC) #19
Alexander Potapenko
LGTM https://codereview.webrtc.org/1246073002/diff/40001/webrtc/video/video_capture_input.cc File webrtc/video/video_capture_input.cc (right): https://codereview.webrtc.org/1246073002/diff/40001/webrtc/video/video_capture_input.cc#newcode66 webrtc/video/video_capture_input.cc:66: rtc::AtomicOps::Increment(&stop_); Isn't rtc::AtomicOps::ReleaseStore(&stop, 1) enough here?
5 years, 5 months ago (2015-07-22 13:43:00 UTC) #20
pbos-webrtc
s/Increment/ReleaseStore
5 years, 5 months ago (2015-07-22 13:50:45 UTC) #21
pbos-webrtc
https://codereview.webrtc.org/1246073002/diff/40001/webrtc/video/video_capture_input.cc File webrtc/video/video_capture_input.cc (right): https://codereview.webrtc.org/1246073002/diff/40001/webrtc/video/video_capture_input.cc#newcode66 webrtc/video/video_capture_input.cc:66: rtc::AtomicOps::Increment(&stop_); On 2015/07/22 13:43:00, Alexander Potapenko wrote: > Isn't ...
5 years, 5 months ago (2015-07-22 13:51:04 UTC) #22
Dmitry Vyukov
LGTM Yes, load and store are faster with this change. In particular, load is way ...
5 years, 5 months ago (2015-07-22 14:06:47 UTC) #23
pbos-webrtc
Thanks, TBR=tommi@ for landing since he's OOO and he's the one I want to take ...
5 years, 5 months ago (2015-07-22 14:25:59 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1246073002/60001
5 years, 5 months ago (2015-07-22 14:26:10 UTC) #27
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 5 months ago (2015-07-22 15:35:03 UTC) #28
commit-bot: I haz the power
5 years, 5 months ago (2015-07-22 15:35:10 UTC) #29
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/235c35f292f8e225a155d98a018e257a7db442c4
Cr-Commit-Position: refs/heads/master@{#9613}

Powered by Google App Engine
This is Rietveld 408576698