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

Issue 2010173005: Support experiment to store persistent metrics in memory-mapped file. (Closed)

Created:
4 years, 6 months ago by bcwhite
Modified:
4 years, 5 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support experiment to store persistent metrics in memory-mapped file. Metrics have to be persisted to disk and one possibility is to simply use file-backed memory which leaves the responsibility to the OS. It is simple and reliable but there are concerns about what impact this could have on performance. Enabling this as an experiment will allow direct collection of real data as to how Chrome is affected by it and thus make possible an informed decision about whether to use it or not. BUG=546019 Committed: https://crrev.com/2a27d6c635cedc801939765d271834b15ea4d299 Cr-Commit-Position: refs/heads/master@{#403368}

Patch Set 1 #

Patch Set 2 : restored lost line #

Patch Set 3 : omit file actions on NACL builds #

Patch Set 4 : rebased #

Total comments: 7

Patch Set 5 : moved file cleanup to anonymous function #

Total comments: 16

Patch Set 6 : addressed (most) review comments by Ilya #

Patch Set 7 : switch to variation parameter #

Patch Set 8 : rebased #

Total comments: 8

Patch Set 9 : rebased #

Patch Set 10 : addressed review comments by Alexei #

Total comments: 12

Patch Set 11 : some comment changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -12 lines) Patch
M base/metrics/persistent_histogram_allocator.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M base/metrics/persistent_histogram_allocator.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_field_trials.cc View 1 2 3 4 5 6 7 8 9 2 chunks +53 lines, -12 lines 0 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (11 generated)
bcwhite
4 years, 6 months ago (2016-06-13 12:53:15 UTC) #3
bcwhite
4 years, 6 months ago (2016-06-15 23:21:49 UTC) #5
Alexei Svitkine (slow)
Besides the comments below, please expand the CL description with more info - for example ...
4 years, 6 months ago (2016-06-16 11:36:57 UTC) #6
bcwhite
https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc#newcode63 chrome/browser/chrome_browser_field_trials.cc:63: if (feature_group.empty() || feature_group == "Disabled") On 2016/06/16 11:36:57, ...
4 years, 6 months ago (2016-06-16 14:21:08 UTC) #8
Alexei Svitkine (slow)
https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc#newcode63 chrome/browser/chrome_browser_field_trials.cc:63: if (feature_group.empty() || feature_group == "Disabled") On 2016/06/16 14:21:08, ...
4 years, 6 months ago (2016-06-16 14:28:02 UTC) #9
bcwhite
https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc#newcode63 chrome/browser/chrome_browser_field_trials.cc:63: if (feature_group.empty() || feature_group == "Disabled") On 2016/06/16 14:28:02, ...
4 years, 6 months ago (2016-06-16 14:31:43 UTC) #10
Alexei Svitkine (slow)
https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc#newcode63 chrome/browser/chrome_browser_field_trials.cc:63: if (feature_group.empty() || feature_group == "Disabled") On 2016/06/16 14:31:43, ...
4 years, 6 months ago (2016-06-16 14:34:40 UTC) #11
bcwhite
On 2016/06/16 14:34:40, Alexei Svitkine (OOO) wrote: > https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc > File chrome/browser/chrome_browser_field_trials.cc (right): > > ...
4 years, 6 months ago (2016-06-16 14:42:31 UTC) #12
bcwhite
On 2016/06/16 14:34:40, Alexei Svitkine (OOO) wrote: > https://codereview.chromium.org/2010173005/diff/100001/chrome/browser/chrome_browser_field_trials.cc > File chrome/browser/chrome_browser_field_trials.cc (right): > > ...
4 years, 6 months ago (2016-06-16 14:42:32 UTC) #13
Alexei Svitkine (slow)
I'm in Munich right and only working today. It's about 5PM now so I'm about ...
4 years, 6 months ago (2016-06-16 14:44:46 UTC) #14
bcwhite
On 2016/06/16 14:44:46, Alexei Svitkine (OOO) wrote: > I'm in Munich right and only working ...
4 years, 6 months ago (2016-06-16 14:46:00 UTC) #15
Alexei Svitkine (slow)
Yes, I don't think the CL should be submitted as-is. Shall we wait until you're ...
4 years, 6 months ago (2016-06-16 14:47:36 UTC) #16
bcwhite
> Yes, I don't think the CL should be submitted as-is. Shall we wait until ...
4 years, 6 months ago (2016-06-16 14:48:22 UTC) #17
Alexei Svitkine (slow)
If not, you can ask another reviewer to continue the review on my behalf. On ...
4 years, 6 months ago (2016-06-16 15:26:33 UTC) #18
bcwhite
+Ilya, would you mind continuing this? I'd like to get this in before the branch-point ...
4 years, 6 months ago (2016-06-16 18:46:52 UTC) #20
Ilya Sherman
Here's one round of comments, but I'll also be OOO next week -- sorry! https://codereview.chromium.org/2010173005/diff/120001/base/metrics/persistent_histogram_allocator.h ...
4 years, 6 months ago (2016-06-17 19:54:33 UTC) #21
Ilya Sherman
https://codereview.chromium.org/2010173005/diff/120001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/120001/chrome/browser/chrome_browser_field_trials.cc#newcode79 chrome/browser/chrome_browser_field_trials.cc:79: ChromeMetricsServiceClient::kBrowserMetricsName); On 2016/06/17 19:54:32, Ilya Sherman (Away June 18-26) ...
4 years, 6 months ago (2016-06-17 19:57:23 UTC) #22
bcwhite
I honestly don't see the improvement in a Variation over the Group Name. It's especially ...
4 years, 6 months ago (2016-06-20 16:21:28 UTC) #23
bcwhite
+jar, Alexei and Ilya are away this week and I'm away for the two after ...
4 years, 6 months ago (2016-06-20 19:45:19 UTC) #25
bcwhite
Ping?
4 years, 5 months ago (2016-06-28 02:42:26 UTC) #26
Alexei Svitkine (slow)
https://codereview.chromium.org/2010173005/diff/180001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/180001/chrome/browser/chrome_browser_field_trials.cc#newcode36 chrome/browser/chrome_browser_field_trials.cc:36: void InstantiatePersistentHistograms() { Both this code and corresponding code ...
4 years, 5 months ago (2016-06-28 15:08:01 UTC) #27
bcwhite
https://codereview.chromium.org/2010173005/diff/180001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/180001/chrome/browser/chrome_browser_field_trials.cc#newcode36 chrome/browser/chrome_browser_field_trials.cc:36: void InstantiatePersistentHistograms() { On 2016/06/28 15:08:00, Alexei Svitkine (very ...
4 years, 5 months ago (2016-06-29 03:17:04 UTC) #29
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode197 chrome/browser/metrics/chrome_metrics_service_client.cc:197: // Open (with delete) and then immediately close ...
4 years, 5 months ago (2016-06-29 19:13:44 UTC) #30
Ilya Sherman
https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc#newcode64 chrome/browser/chrome_browser_field_trials.cc:64: const size_t kAllocSize = 3 << 20; // 3 ...
4 years, 5 months ago (2016-06-29 20:41:38 UTC) #31
bcwhite
https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc#newcode64 chrome/browser/chrome_browser_field_trials.cc:64: const size_t kAllocSize = 3 << 20; // 3 ...
4 years, 5 months ago (2016-06-30 22:56:12 UTC) #32
Ilya Sherman
LGTM. Thanks, Brian. https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc File chrome/browser/chrome_browser_field_trials.cc (right): https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_browser_field_trials.cc#newcode64 chrome/browser/chrome_browser_field_trials.cc:64: const size_t kAllocSize = 3 << ...
4 years, 5 months ago (2016-06-30 23:16:48 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2010173005/260001
4 years, 5 months ago (2016-06-30 23:19:33 UTC) #36
commit-bot: I haz the power
Committed patchset #11 (id:260001)
4 years, 5 months ago (2016-07-01 00:27:53 UTC) #38
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-01 00:27:56 UTC) #39
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/2a27d6c635cedc801939765d271834b15ea4d299 Cr-Commit-Position: refs/heads/master@{#403368}
4 years, 5 months ago (2016-07-01 00:29:30 UTC) #41
Alexei Svitkine (slow)
On 2016/06/20 16:21:28, bcwhite wrote: > I honestly don't see the improvement in a Variation ...
4 years, 5 months ago (2016-07-04 21:52:50 UTC) #42
bcwhite
4 years, 5 months ago (2016-07-11 18:06:40 UTC) #43
Message was sent while issue was closed.
Sorry I couldn't get to this earlier.  I was in Costa Rica with limited internet
and a deadline.  I'll update the comment in a new CL along with some other
cleanup.

https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_...
File chrome/browser/chrome_browser_field_trials.cc (right):

https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/chrome_...
chrome/browser/chrome_browser_field_trials.cc:64: const size_t kAllocSize = 3 <<
20;     // 3 MiB
On 2016/06/30 23:16:48, Ilya Sherman wrote:
> On 2016/06/30 22:56:12, bcwhite wrote:
> > On 2016/06/29 20:41:38, Ilya Sherman wrote:
> > > Unrelated to this CL: What happens if the alloc size is exceeded, by the
> way?
> > 
> > In that case, new histograms will get allocated from the heap.  Everything
> will
> > run as normal except those on the heap will not be persisted.
> 
> Okay, sounds good.  Do we have metrics in place to measure how frequently this
> occurs in practice?

Not directly.  There is a measure of how much of the memory segment is used. 
There is also a measure of how many histograms are allocated from each of heap
and persistent memory.

https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/metrics...
File chrome/browser/metrics/chrome_metrics_service_client.cc (right):

https://codereview.chromium.org/2010173005/diff/240001/chrome/browser/metrics...
chrome/browser/metrics/chrome_metrics_service_client.cc:199: // that may be open
elsewhere.
On 2016/06/30 23:16:48, Ilya Sherman wrote:
> On 2016/06/30 22:56:12, bcwhite wrote:
> > On 2016/06/29 20:41:38, Ilya Sherman wrote:
> > > If the file is open elsewhere, is there anything that guarantees that
there
> > > won't be any further attempts to read from or write to the file?
> > 
> > None.  Existing opens will continue to operate normally.  New opens will
fail
> > and the actual contents will be free'd once the last open handle gets
closed.
> 
> Ah, nice.  I think this would be great to document explicitly in this comment
--
> that behavior wasn't obvious to me.

Will do.

Powered by Google App Engine
This is Rietveld 408576698