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

Issue 22849002: Rewrite SamplingCircularQueue (Closed)

Created:
7 years, 4 months ago by yurys
Modified:
7 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

Rewrite SamplingCircularQueue The new implementation: * uses MemoryBarriers to make sure up-to-date data is accessed on both producer and consumer threads * will not allow to overwrite records * doesn't have notion of chunks, instead each entry is aligned on the cache line boundaries BUG=v8:2814 R=bmeurer@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=16284

Patch Set 1 #

Patch Set 2 : Don't create extra copy of event #

Total comments: 13

Patch Set 3 : The queue was templatized, comments addressed except supporting MPSC #

Patch Set 4 : Deleted circular-queue.cc #

Total comments: 13

Patch Set 5 : Supported ALIGNED_AT on __APPLE__ #

Patch Set 6 : Comments addressed #

Total comments: 6

Patch Set 7 : Comments addressed #

Patch Set 8 : Formatting #

Patch Set 9 : Comments addressed #

Patch Set 10 : Moved ALIGNAS to globals.h #

Patch Set 11 : Rebase #

Patch Set 12 : Use V8_ALIGNAS from include/v8config.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -270 lines) Patch
M src/circular-queue.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +24 lines, -39 lines 0 comments Download
M src/circular-queue.cc View 1 2 3 1 chunk +0 lines, -125 lines 0 comments Download
M src/circular-queue-inl.h View 1 2 3 4 5 1 chunk +46 lines, -16 lines 0 comments Download
M src/cpu-profiler.h View 1 2 9 10 4 chunks +9 lines, -7 lines 0 comments Download
M src/cpu-profiler.cc View 1 2 9 10 5 chunks +4 lines, -29 lines 0 comments Download
M src/cpu-profiler-inl.h View 1 chunk +19 lines, -2 lines 0 comments Download
M src/globals.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M src/sampler.cc View 9 10 3 chunks +5 lines, -2 lines 0 comments Download
M src/v8globals.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-circular-queue.cc View 1 2 5 chunks +39 lines, -46 lines 0 comments Download
M test/cctest/test-cpu-profiler.cc View 9 10 3 chunks +4 lines, -2 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 26 (0 generated)
yurys
7 years, 4 months ago (2013-08-12 14:27:03 UTC) #1
yurys
Benedikt, can you take a look?
7 years, 4 months ago (2013-08-12 14:27:46 UTC) #2
yurys
I did some perf measurements on 3 devices(HP z620, Galaxy Nexus and Lenovo T60p) with ...
7 years, 4 months ago (2013-08-12 15:16:05 UTC) #3
yurys
7 years, 4 months ago (2013-08-12 15:24:21 UTC) #4
Benedikt Meurer
I don't think the new implementation actually improves the situation. The case for multiple producers ...
7 years, 4 months ago (2013-08-13 09:31:32 UTC) #5
Benedikt Meurer
BTW I did not carefully check the memory-ordering semantics of my suggestions above.
7 years, 4 months ago (2013-08-13 09:37:38 UTC) #6
yurys
On 2013/08/13 09:31:32, Benedikt Meurer wrote: > I don't think the new implementation actually improves ...
7 years, 4 months ago (2013-08-13 10:03:43 UTC) #7
yurys
https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc File src/circular-queue.cc (right): https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc#newcode81 src/circular-queue.cc:81: MemoryBarrier(); On 2013/08/13 09:31:32, Benedikt Meurer wrote: > Why ...
7 years, 4 months ago (2013-08-13 10:05:20 UTC) #8
Benedikt Meurer
On 2013/08/13 10:05:20, Yury Semikhatsky wrote: > https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc > File src/circular-queue.cc (right): > > https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc#newcode81 ...
7 years, 4 months ago (2013-08-13 10:28:12 UTC) #9
Benedikt Meurer
On 2013/08/13 10:03:43, Yury Semikhatsky wrote: > On 2013/08/13 09:31:32, Benedikt Meurer wrote: > > ...
7 years, 4 months ago (2013-08-13 11:14:59 UTC) #10
yurys
On 2013/08/13 10:28:12, Benedikt Meurer wrote: > On 2013/08/13 10:05:20, Yury Semikhatsky wrote: > > ...
7 years, 4 months ago (2013-08-13 11:59:53 UTC) #11
Benedikt Meurer
On 2013/08/13 11:59:53, Yury Semikhatsky wrote: > On 2013/08/13 10:28:12, Benedikt Meurer wrote: > > ...
7 years, 4 months ago (2013-08-13 12:01:40 UTC) #12
yurys
Benedikt, please take another look. https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc File src/circular-queue.cc (right): https://codereview.chromium.org/22849002/diff/2001/src/circular-queue.cc#newcode94 src/circular-queue.cc:94: } On 2013/08/13 09:31:32, ...
7 years, 4 months ago (2013-08-13 14:10:29 UTC) #13
Benedikt Meurer
Ok, next round of comments. https://codereview.chromium.org/22849002/diff/23001/src/allocation.h File src/allocation.h (right): https://codereview.chromium.org/22849002/diff/23001/src/allocation.h#newcode39 src/allocation.h:39: // ALIGNAS(16) int array[4]; ...
7 years, 4 months ago (2013-08-13 14:29:41 UTC) #14
yurys
PTAL https://codereview.chromium.org/22849002/diff/23001/src/allocation.h File src/allocation.h (right): https://codereview.chromium.org/22849002/diff/23001/src/allocation.h#newcode39 src/allocation.h:39: // ALIGNAS(16) int array[4]; On 2013/08/13 14:29:42, Benedikt ...
7 years, 4 months ago (2013-08-13 14:52:37 UTC) #15
yurys
https://codereview.chromium.org/22849002/diff/23001/src/circular-queue.h File src/circular-queue.h (right): https://codereview.chromium.org/22849002/diff/23001/src/circular-queue.h#newcode78 src/circular-queue.h:78: Atomic32 marker ALIGN_AT(sizeof(Atomic32)); On 2013/08/13 14:52:37, Yury Semikhatsky wrote: ...
7 years, 4 months ago (2013-08-13 15:28:53 UTC) #16
Benedikt Meurer
https://codereview.chromium.org/22849002/diff/32001/src/allocation.h File src/allocation.h (right): https://codereview.chromium.org/22849002/diff/32001/src/allocation.h#newcode36 src/allocation.h:36: // Specify memory alignment for structs, classes, etc. Please ...
7 years, 4 months ago (2013-08-14 11:38:09 UTC) #17
yurys
https://codereview.chromium.org/22849002/diff/32001/src/allocation.h File src/allocation.h (right): https://codereview.chromium.org/22849002/diff/32001/src/allocation.h#newcode36 src/allocation.h:36: // Specify memory alignment for structs, classes, etc. On ...
7 years, 4 months ago (2013-08-14 13:19:00 UTC) #18
Benedikt Meurer
Ok, almost there. Just one nit with ALIGN_AT(). Please rename to ALIGNAS() and use alignas() ...
7 years, 4 months ago (2013-08-19 06:12:10 UTC) #19
yurys
On 2013/08/19 06:12:10, Benedikt Meurer wrote: > Ok, almost there. Just one nit with ALIGN_AT(). ...
7 years, 4 months ago (2013-08-19 06:30:44 UTC) #20
Benedikt Meurer
On 2013/08/19 06:30:44, Yury Semikhatsky wrote: > On 2013/08/19 06:12:10, Benedikt Meurer wrote: > > ...
7 years, 4 months ago (2013-08-19 06:43:57 UTC) #21
yurys
On 2013/08/19 06:43:57, Benedikt Meurer wrote: > On 2013/08/19 06:30:44, Yury Semikhatsky wrote: > > ...
7 years, 4 months ago (2013-08-19 06:58:50 UTC) #22
Benedikt Meurer
On 2013/08/19 06:58:50, Yury Semikhatsky wrote: > On 2013/08/19 06:43:57, Benedikt Meurer wrote: > > ...
7 years, 4 months ago (2013-08-23 07:47:32 UTC) #23
yurys
On 2013/08/23 07:47:32, Benedikt Meurer wrote: > On 2013/08/19 06:58:50, Yury Semikhatsky wrote: > > ...
7 years, 4 months ago (2013-08-23 08:11:47 UTC) #24
Benedikt Meurer
LGTM again, please go ahead.
7 years, 4 months ago (2013-08-23 08:14:39 UTC) #25
yurys
7 years, 4 months ago (2013-08-23 08:22:26 UTC) #26
Message was sent while issue was closed.
Committed patchset #12 manually as r16284.

Powered by Google App Engine
This is Rietveld 408576698