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

Issue 2885363004: [Hacky prototype] Create a shared-memory high-performance reporting service.

Created:
3 years, 7 months ago by chrisha
Modified:
3 years, 7 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), darin-cc_chromium.org, jam, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Hacky prototype] Create a shared-memory high-performance reporting service. This is an exploration into ways to share high-frequency performance data from child services to a central aggregation service. I'd anticipate that BlamableObjects would route their data to appropriate structures in these shared memory segments and that the central service would asynchronously scrape the data on its own schedule. Round-trip IPC would only be required when new shared memory segments are required. This is built on top of the PersistentMemoryAllocator infrastructure built for UMA. This is effectively a lock-free thread-safe allocator built with atomics and with performance in mind. It is self-describing and allows a remote process to iterate and discover data as it is written. BUG=

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+1155 lines, --1 lines) Patch
M content/browser/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_manager/service_manager_context.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M content/public/app/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/app/mojo/content_browser_manifest.json View 2 chunks +2 lines, -0 lines 0 comments Download
M services/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A services/blamer/BUILD.gn View 1 chunk +100 lines, -0 lines 0 comments Download
A services/blamer/blamer_service.h View 1 chunk +35 lines, -0 lines 0 comments Download
A services/blamer/blamer_service.cc View 1 chunk +51 lines, -0 lines 0 comments Download
A services/blamer/heap_object_types.h View 1 chunk +29 lines, -0 lines 0 comments Download
A services/blamer/heap_objects/blame_data.h View 1 chunk +41 lines, -0 lines 0 comments Download
A services/blamer/heap_objects/blame_data.cc View 0 chunks +-1 lines, --1 lines 0 comments Download
A services/blamer/manifest.json View 1 chunk +17 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/BUILD.gn View 1 chunk +20 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/blame_classes.h View 1 chunk +71 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/blame_node.h View 1 chunk +102 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/blame_node.cc View 1 chunk +25 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/blamer_interface.h View 1 chunk +43 lines, -0 lines 0 comments Download
A services/blamer/public/cpp/blamer_interface.cc View 1 chunk +74 lines, -0 lines 0 comments Download
A services/blamer/public/interfaces/BUILD.gn View 1 chunk +16 lines, -0 lines 0 comments Download
A services/blamer/public/interfaces/service_constants.mojom View 1 chunk +11 lines, -0 lines 0 comments Download
A services/blamer/public/interfaces/shared_memory_heap_registry.mojom View 1 chunk +54 lines, -0 lines 2 comments Download
A services/blamer/service_main.cc View 1 chunk +12 lines, -0 lines 0 comments Download
A services/blamer/shared_memory_heap.h View 1 chunk +155 lines, -0 lines 0 comments Download
A services/blamer/shared_memory_heap.cc View 1 chunk +143 lines, -0 lines 3 comments Download
A services/blamer/shared_memory_heap_registry.h View 1 chunk +39 lines, -0 lines 0 comments Download
A services/blamer/shared_memory_heap_registry.cc View 1 chunk +93 lines, -0 lines 0 comments Download
A services/blamer/unittest_manifest.json View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
chrisha
There are aborted bits of code in here that can be ignore. BlameNode was an ...
3 years, 7 months ago (2017-05-18 21:58:35 UTC) #1
Sami
I've didn't look at the BlameNode stuff too deeply. Is the basic idea with the ...
3 years, 7 months ago (2017-05-19 13:44:04 UTC) #3
oystein (OOO til 10th of July)
Closing as I'm landing this for holte@ in https://codereview.chromium.org/2893943004.
3 years, 7 months ago (2017-05-22 21:43:34 UTC) #5
oystein (OOO til 10th of July)
On 2017/05/22 at 21:43:34, oystein wrote: > Closing as I'm landing this for holte@ in ...
3 years, 7 months ago (2017-05-22 21:44:06 UTC) #6
chrisha
On 2017/05/19 13:44:04, Sami wrote: > I've didn't look at the BlameNode stuff too deeply. ...
3 years, 7 months ago (2017-05-25 17:59:52 UTC) #7
chrisha
https://codereview.chromium.org/2885363004/diff/1/services/blamer/public/interfaces/shared_memory_heap_registry.mojom File services/blamer/public/interfaces/shared_memory_heap_registry.mojom (right): https://codereview.chromium.org/2885363004/diff/1/services/blamer/public/interfaces/shared_memory_heap_registry.mojom#newcode40 services/blamer/public/interfaces/shared_memory_heap_registry.mojom:40: uint32 size; On 2017/05/19 13:44:04, Sami wrote: > This ...
3 years, 7 months ago (2017-05-25 18:05:08 UTC) #8
Sami
On 2017/05/25 17:59:52, chrisha wrote: > The underlying primitive here is already multiple-writer multiple-reader > ...
3 years, 7 months ago (2017-05-26 09:42:11 UTC) #9
chrisha
3 years, 7 months ago (2017-05-26 18:36:43 UTC) #10
On 2017/05/26 09:42:11, Sami wrote:
> On 2017/05/25 17:59:52, chrisha wrote:
> > The underlying primitive here is already multiple-writer multiple-reader
> > thread-safe using various lock-free algos. See:
> > 
> >
>
https://cs.chromium.org/chromium/src/base/metrics/persistent_memory_allocator.h
> 
> I might have missed something but looks like that makes it safe to share the
> allocations themselves but doesn't give any guarantees about the contents of
the
> memory:
> 
>
https://cs.chromium.org/chromium/src/base/metrics/persistent_memory_allocator...
> 
> Or maybe we're never modifying the objects written to the allocation?

As long as we use appropriately aligned atomic primitives for the actual content
of the allocations then we shouldn't have to worry about tearing. But yes, if
we're using things that cross cache lines all bets are off. I was primarily
imagining this for numeric data (counts, sizes, rates, what have you) using
atomic primitives.

If we need to communicate more complicated things then yes, we'll need to worry
about this problem.

Powered by Google App Engine
This is Rietveld 408576698