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

Issue 8772004: Improve GamepadSeqLock impl

Created:
9 years ago by dvyukov
Modified:
8 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, dpranke-watch+content_chromium.org
Visibility:
Public.

Description

Lock-free GamepadSeqLock The change - provides an improved lock-free SeqLock implementation which eliminates any potential blocking of readers. - provides a higher-level and simpler API as was suggested by Darin. - ThreadSanitizer report suppressions are replaced with correct synchronization. - eliminates nasty kMaximumContentionCount and associated histogram. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=143903

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 29

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Total comments: 6

Patch Set 8 : '' #

Total comments: 2

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 6

Patch Set 12 : '' #

Patch Set 13 : '' #

Patch Set 14 : '' #

Total comments: 12

Patch Set 15 : #

Total comments: 3

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Patch Set 20 : #

Patch Set 21 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -126 lines) Patch
M content/browser/gamepad/gamepad_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +3 lines, -8 lines 0 comments Download
M content/browser/gamepad/gamepad_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +9 lines, -16 lines 0 comments Download
M content/common/gamepad_hardware_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +5 lines, -2 lines 0 comments Download
M content/common/gamepad_seqlock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +62 lines, -24 lines 0 comments Download
D content/common/gamepad_seqlock.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +71 lines, -33 lines 0 comments Download
M content/common/gamepad_seqlock_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +6 lines, -18 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/gamepad_shared_memory_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -25 lines 0 comments Download
M tools/valgrind/tsan/ignores.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (0 generated)
dvyukov
9 years ago (2011-12-01 14:32:15 UTC) #1
dvyukov
PTAL
9 years ago (2011-12-01 14:32:36 UTC) #2
darin (slow to review)
It really feels like the SeqLock class belongs in src/base/synchronization/ :-) I know there was ...
9 years ago (2011-12-01 17:45:16 UTC) #3
jbates
I like the basic idea of the template and the simple ReadTo API. I'm uncomfortable ...
9 years ago (2011-12-01 19:31:12 UTC) #4
dvyukov
http://codereview.chromium.org/8772004/diff/3002/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/3002/content/common/gamepad_seqlock.h#newcode21 content/common/gamepad_seqlock.h:21: class CONTENT_EXPORT GamepadSeqLock { On 2011/12/01 17:45:16, darin wrote: ...
9 years ago (2011-12-01 21:27:28 UTC) #5
scottmg
Thank you for taking this on Dmitriy, appreciated. I agree that it should live in ...
9 years ago (2011-12-01 22:36:39 UTC) #6
jbates
http://codereview.chromium.org/8772004/diff/3002/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/3002/content/common/gamepad_seqlock.h#newcode57 content/common/gamepad_seqlock.h:57: continue; On 2011/12/01 21:27:28, dvyukov wrote: > On 2011/12/01 ...
9 years ago (2011-12-02 21:40:14 UTC) #7
dvyukov
On 2011/12/01 22:36:39, scottmg wrote: > Thank you for taking this on Dmitriy, appreciated. > ...
9 years ago (2011-12-03 09:06:03 UTC) #8
dvyukov
http://codereview.chromium.org/8772004/diff/3002/content/browser/gamepad/gamepad_provider_unittest.cc File content/browser/gamepad/gamepad_provider_unittest.cc (right): http://codereview.chromium.org/8772004/diff/3002/content/browser/gamepad/gamepad_provider_unittest.cc#newcode91 content/browser/gamepad/gamepad_provider_unittest.cc:91: output.length = 0; On 2011/12/01 22:36:39, scottmg wrote: > ...
9 years ago (2011-12-03 10:12:14 UTC) #9
dvyukov
On 2011/12/01 19:31:12, jbates wrote: > http://codereview.chromium.org/8772004/diff/3002/content/common/gamepad_seqlock.h#newcode88 > content/common/gamepad_seqlock.h:88: NoBarrier_Store(&ent->data_[i], tmp[i]); > Why not store ...
9 years ago (2011-12-03 10:26:38 UTC) #10
dvyukov
PTAL I've resolved most of the remarks. Does the comments make sense to you? I've ...
9 years ago (2011-12-03 10:31:04 UTC) #11
dvyukov
On 2011/12/02 21:40:14, jbates wrote: > After rereading the code 10 times or so :), ...
9 years ago (2011-12-03 10:33:18 UTC) #12
scottmg
looks good. http://codereview.chromium.org/8772004/diff/9005/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/9005/content/common/gamepad_seqlock.h#newcode77 content/common/gamepad_seqlock.h:77: Entry* ent = &entries_[cur % kSize]; kEntries, ...
9 years ago (2011-12-05 18:45:05 UTC) #13
dvyukov
PTAL http://codereview.chromium.org/8772004/diff/9005/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/9005/content/common/gamepad_seqlock.h#newcode77 content/common/gamepad_seqlock.h:77: Entry* ent = &entries_[cur % kSize]; On 2011/12/05 ...
9 years ago (2011-12-07 09:35:50 UTC) #14
dvyukov
On 2011/12/05 18:45:05, scottmg wrote: > http://codereview.chromium.org/8772004/diff/9005/content/common/gamepad_seqlock_unittest.cc#newcode36 > content/common/gamepad_seqlock_unittest.cc:36: for (unsigned i = 0; i ...
9 years ago (2011-12-07 09:40:07 UTC) #15
scottmg
On 2011/12/07 09:35:50, dvyukov wrote: > PTAL lgtm, but darin and/or jbates will need to ...
9 years ago (2011-12-07 19:18:06 UTC) #16
jbates
lgtm http://codereview.chromium.org/8772004/diff/16001/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/16001/content/common/gamepad_seqlock.h#newcode115 content/common/gamepad_seqlock.h:115: // Switch the current object. The reason for ...
9 years ago (2011-12-08 01:02:36 UTC) #17
dvyukov
http://codereview.chromium.org/8772004/diff/16001/content/common/gamepad_seqlock.h File content/common/gamepad_seqlock.h (right): http://codereview.chromium.org/8772004/diff/16001/content/common/gamepad_seqlock.h#newcode115 content/common/gamepad_seqlock.h:115: // Switch the current object. On 2011/12/08 01:02:36, jbates ...
9 years ago (2011-12-08 09:28:11 UTC) #18
dvyukov
I've resynched my client and added back 'common/gamepad_seqlock_unittest.cc' to content/content_tests.gypi.
9 years ago (2011-12-08 12:09:52 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dvyukov@chromium.org/8772004/31002
9 years ago (2011-12-08 12:12:04 UTC) #20
commit-bot: I haz the power
Presubmit check for 8772004-31002 failed and returned exit status 1. Running presubmit commit checks ...
9 years ago (2011-12-08 12:12:11 UTC) #21
darin (slow to review)
http://codereview.chromium.org/8772004/diff/32004/content/browser/gamepad/gamepad_provider_unittest.cc File content/browser/gamepad/gamepad_provider_unittest.cc (right): http://codereview.chromium.org/8772004/diff/32004/content/browser/gamepad/gamepad_provider_unittest.cc#newcode22 content/browser/gamepad/gamepad_provider_unittest.cc:22: explicit MockDataFetcher(WebGamepads const& test_data) { nit: please stick with ...
9 years ago (2011-12-08 22:10:48 UTC) #22
dvyukov
PTAL http://codereview.chromium.org/8772004/diff/32004/content/browser/gamepad/gamepad_provider_unittest.cc File content/browser/gamepad/gamepad_provider_unittest.cc (right): http://codereview.chromium.org/8772004/diff/32004/content/browser/gamepad/gamepad_provider_unittest.cc#newcode22 content/browser/gamepad/gamepad_provider_unittest.cc:22: explicit MockDataFetcher(WebGamepads const& test_data) { On 2011/12/08 22:10:48, ...
9 years ago (2011-12-13 13:46:20 UTC) #23
dvyukov
ping On Tue, Dec 13, 2011 at 4:46 PM, <dvyukov@chromium.org> wrote: > PTAL > > ...
9 years ago (2011-12-18 10:35:11 UTC) #24
dvyukov
I've resynced the client. PTAL.
8 years, 11 months ago (2012-01-12 14:40:38 UTC) #25
jbates
High level, looking good. http://codereview.chromium.org/8772004/diff/46001/content/common/gamepad_seqlock.cc File content/common/gamepad_seqlock.cc (right): http://codereview.chromium.org/8772004/diff/46001/content/common/gamepad_seqlock.cc#newcode16 content/common/gamepad_seqlock.cc:16: entries_[i] = (Entry*)((char*)entries + i ...
8 years, 10 months ago (2012-02-17 23:29:51 UTC) #26
dvyukov
All done. PTAL. http://codereview.chromium.org/8772004/diff/46001/content/common/gamepad_seqlock.cc File content/common/gamepad_seqlock.cc (right): http://codereview.chromium.org/8772004/diff/46001/content/common/gamepad_seqlock.cc#newcode16 content/common/gamepad_seqlock.cc:16: entries_[i] = (Entry*)((char*)entries + i * ...
8 years, 10 months ago (2012-02-21 15:18:04 UTC) #27
jbates
LGTM
8 years, 10 months ago (2012-02-21 17:34:52 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dvyukov@chromium.org/8772004/53001
8 years, 10 months ago (2012-02-21 17:35:54 UTC) #29
commit-bot: I haz the power
Presubmit check for 8772004-53001 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 10 months ago (2012-02-21 17:36:01 UTC) #30
dvyukov
On 2012/02/21 17:36:01, I haz the power (commit-bot) wrote: > Presubmit check for 8772004-53001 failed ...
8 years, 10 months ago (2012-02-22 08:04:51 UTC) #31
dvyukov
On 2012/02/22 08:04:51, dvyukov wrote: > On 2012/02/21 17:36:01, I haz the power (commit-bot) wrote: ...
8 years, 10 months ago (2012-02-24 08:27:39 UTC) #32
brettw
Please pick one person and ask them rather than spamming all of the most already-overloaded ...
8 years, 10 months ago (2012-02-24 16:58:24 UTC) #33
scottmg
Hi, Could I dredge this up from the ancient past to try to get it ...
8 years, 6 months ago (2012-06-19 19:31:48 UTC) #34
Dmitry Vyukov
On 2012/06/19 19:31:48, scottmg wrote: > Hi, Could I dredge this up from the ancient ...
8 years, 6 months ago (2012-06-19 19:42:59 UTC) #35
darin (slow to review)
LGTM https://chromiumcodereview.appspot.com/8772004/diff/53001/content/common/gamepad_seqlock.cc File content/common/gamepad_seqlock.cc (right): https://chromiumcodereview.appspot.com/8772004/diff/53001/content/common/gamepad_seqlock.cc#newcode13 content/common/gamepad_seqlock.cc:13: const size_t entSize = sizeof(BaseEntry) + sizeof(Atomic32) * ...
8 years, 6 months ago (2012-06-19 21:14:35 UTC) #36
Dmitry Vyukov
On 2012/06/19 21:14:35, darin wrote: > LGTM > > https://chromiumcodereview.appspot.com/8772004/diff/53001/content/common/gamepad_seqlock.cc > File content/common/gamepad_seqlock.cc (right): > ...
8 years, 6 months ago (2012-06-22 15:29:17 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dvyukov@chromium.org/8772004/82002
8 years, 6 months ago (2012-06-23 17:58:09 UTC) #38
commit-bot: I haz the power
Try job failure for 8772004-82002 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 6 months ago (2012-06-23 18:14:42 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dvyukov@chromium.org/8772004/82004
8 years, 6 months ago (2012-06-25 11:30:25 UTC) #40
commit-bot: I haz the power
Change committed as 143903
8 years, 6 months ago (2012-06-25 13:47:41 UTC) #41
Dmitry Vyukov
On 2012/06/19 19:31:48, scottmg wrote: > Hi, Could I dredge this up from the ancient ...
8 years, 6 months ago (2012-06-25 13:51:08 UTC) #42
scottmg
Thanks Dmitriy! On Mon, Jun 25, 2012 at 6:51 AM, <dvyukov@google.com> wrote: > On 2012/06/19 ...
8 years, 6 months ago (2012-06-25 16:54:25 UTC) #43
dvyukov
8 years, 5 months ago (2012-07-13 11:04:24 UTC) #44
On 2012/06/25 16:54:25, scottmg wrote:
> Thanks Dmitriy!
> 
> On Mon, Jun 25, 2012 at 6:51 AM,  <mailto:dvyukov@google.com> wrote:
> > On 2012/06/19 19:31:48, scottmg wrote:
> >>
> >> Hi, Could I dredge this up from the ancient past to try to get it landed?
> >> I
> >> believe there are timeouts being caused on the WebKit bots due to the
> >> current
> >> implementation starving in test code.
> >
> >
> >
> >
>
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=pla...
> >
> > Landed.
> >
> >
> > https://chromiumcodereview.appspot.com/8772004/


FTR,
This patch was reverted. Here is another reincarnation:
https://chromiumcodereview.appspot.com/10704041/

Powered by Google App Engine
This is Rietveld 408576698