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

Issue 2654073002: base: Introduce SharedMemoryTracker for POSIX (but not macOS) (Closed)

Created:
3 years, 11 months ago by hajimehoshi
Modified:
3 years, 9 months ago
CC:
chromium-reviews, gavinp+memory_chromium.org, haraken, tasak, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Introduce SharedMemoryTracker for POSIX (but not macOS) This CL introduces SharedMemoryTracker to measure memory usage of SharedMemoy correctly and report them to memory-infra. SharedMemoryTracker records the memory usage when mmap-ing and when unmmap-ing, and reports them when OnMemoryDump is called. This enables to help us know SharedMemory usage correctly. This is a part of a CL (https://codereview.chromium.org/2535213002/) for SharedMemory usage measuring. BUG=604726 Review-Url: https://codereview.chromium.org/2654073002 Cr-Commit-Position: refs/heads/master@{#455406} Committed: https://chromium.googlesource.com/chromium/src/+/2acea43a7272838a75e4c6b7e5473dd6f9c4aa79

Patch Set 1 #

Patch Set 2 : Disable SharedMemoryTracker on non-posix or mac #

Patch Set 3 : Add comments #

Total comments: 30

Patch Set 4 : Address on reviews #

Patch Set 5 : Address on reviews #

Total comments: 25

Patch Set 6 : Address on reviews #

Patch Set 7 : Use AddressHasher #

Total comments: 4

Patch Set 8 : Change the bucket number to 8 for try perf #

Patch Set 9 : Use 1 bucket / actually no more bucket #

Total comments: 16

Patch Set 10 : Address on danakj@'s review #

Total comments: 8

Patch Set 11 : Address on primiano@'s review #

Patch Set 12 : Call fstat just after mmap to get unique IDs #

Patch Set 13 : Add comments #

Patch Set 14 : Fix PRESUBMIT.py #

Total comments: 10

Patch Set 15 : Address on Dana's review #

Patch Set 16 : Address on Dana's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -3 lines) Patch
M PRESUBMIT.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -0 lines 0 comments Download
M base/memory/shared_memory.h View 1 2 3 4 5 6 7 8 9 2 chunks +17 lines, -1 line 0 comments Download
M base/memory/shared_memory_posix.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +25 lines, -2 lines 0 comments Download
A base/memory/shared_memory_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +56 lines, -0 lines 0 comments Download
A base/memory/shared_memory_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +92 lines, -0 lines 0 comments Download

Messages

Total messages: 120 (60 generated)
hajimehoshi
I'm now checking if there is performance regression or not with cc_perftests and page_cycler_v2.typical_25. PTAL
3 years, 11 months ago (2017-01-25 10:39:41 UTC) #6
danakj
Some high level suggestions that kinda negate a lot of the comments below: - Add ...
3 years, 11 months ago (2017-01-25 16:58:13 UTC) #15
ssid
https://codereview.chromium.org/2654073002/diff/40001/base/memory/shared_memory_tracker.cc File base/memory/shared_memory_tracker.cc (right): https://codereview.chromium.org/2654073002/diff/40001/base/memory/shared_memory_tracker.cc#newcode30 base/memory/shared_memory_tracker.cc:30: base::StringPrintf("%s/%s", kSharedMemoryDumpName, id_str.c_str()); On 2017/01/25 16:58:13, danakj (slow) wrote: ...
3 years, 11 months ago (2017-01-25 23:03:06 UTC) #16
hajimehoshi
Thank you for reviewing! On 2017/01/25 16:58:13, danakj (slow) wrote: > Some high level suggestions ...
3 years, 11 months ago (2017-01-26 10:51:03 UTC) #17
hajimehoshi
https://codereview.chromium.org/2654073002/diff/40001/base/BUILD.gn File base/BUILD.gn (right): https://codereview.chromium.org/2654073002/diff/40001/base/BUILD.gn#newcode1542 base/BUILD.gn:1542: if (!(is_posix && !is_mac)) { On 2017/01/25 16:58:12, danakj ...
3 years, 11 months ago (2017-01-26 10:56:00 UTC) #18
danakj
I think I was conflating SharedMemory and SharedMemoryHandle.. see below On Thu, Jan 26, 2017 ...
3 years, 11 months ago (2017-01-26 16:32:45 UTC) #23
hajimehoshi
On 2017/01/26 16:32:45, danakj (slow) wrote: > I think I was conflating SharedMemory and SharedMemoryHandle.. ...
3 years, 10 months ago (2017-01-27 09:47:17 UTC) #32
danakj
> > How did you find the strategy to use buckets with a lock each, ...
3 years, 10 months ago (2017-01-27 16:56:42 UTC) #35
Primiano Tucci (use gerrit)
On 2017/01/27 16:56:42, danakj (slow) wrote: > > > How did you find the strategy ...
3 years, 10 months ago (2017-01-27 20:09:49 UTC) #36
hajimehoshi
Thank you for reviewing! I'm now taking a performance data. My rough prediction is, mmap ...
3 years, 10 months ago (2017-02-07 12:33:45 UTC) #37
hajimehoshi
I have profiled this CL. The result is in https://drive.google.com/open?id=0BwW8PrCcts4WMTNZTGJzVGlDUVU. I tested Telemetry (page_cycler_v2.typical_25) with ...
3 years, 10 months ago (2017-02-08 10:31:29 UTC) #38
Primiano Tucci (use gerrit)
On 2017/02/08 10:31:29, hajimehoshi wrote: > I have profiled this CL. The result is in ...
3 years, 10 months ago (2017-02-08 10:40:19 UTC) #39
hajimehoshi
On 2017/02/08 10:40:19, Primiano Tucci wrote: > On 2017/02/08 10:31:29, hajimehoshi wrote: > > I ...
3 years, 10 months ago (2017-02-08 10:52:03 UTC) #40
hajimehoshi
As primiano@ advised, I did the same test again. The result is: https://drive.google.com/drive/folders/0BwW8PrCcts4WMkZ1bmhsYWxpRG8?usp=sharing * No ...
3 years, 10 months ago (2017-02-09 06:52:45 UTC) #41
hajimehoshi
> 1) Hashing: we did some analysis of heap pointers when we developed the heap ...
3 years, 10 months ago (2017-02-09 10:00:52 UTC) #46
Primiano Tucci (use gerrit)
On 2017/02/09 06:52:45, hajimehoshi wrote: > My rough prediction is, mmap is not called so ...
3 years, 10 months ago (2017-02-09 10:33:48 UTC) #49
hajimehoshi
On 2017/02/09 10:33:48, Primiano Tucci wrote: > On 2017/02/09 06:52:45, hajimehoshi wrote: > > My ...
3 years, 10 months ago (2017-02-10 06:38:13 UTC) #52
hajimehoshi
https://codereview.chromium.org/2654073002/diff/100001/base/memory/shared_memory_tracker.cc File base/memory/shared_memory_tracker.cc (right): https://codereview.chromium.org/2654073002/diff/100001/base/memory/shared_memory_tracker.cc#newcode28 base/memory/shared_memory_tracker.cc:28: usage.first->GetUniqueId(&id); On 2017/02/07 12:33:44, hajimehoshi wrote: > On 2017/01/27 ...
3 years, 10 months ago (2017-02-10 11:05:58 UTC) #53
hajimehoshi
On 2017/02/10 11:05:58, hajimehoshi wrote: > https://codereview.chromium.org/2654073002/diff/100001/base/memory/shared_memory_tracker.cc > File base/memory/shared_memory_tracker.cc (right): > > https://codereview.chromium.org/2654073002/diff/100001/base/memory/shared_memory_tracker.cc#newcode28 > ...
3 years, 10 months ago (2017-02-13 12:13:49 UTC) #54
hajimehoshi
On 2017/02/13 12:13:49, hajimehoshi wrote: > On 2017/02/10 11:05:58, hajimehoshi wrote: > > > https://codereview.chromium.org/2654073002/diff/100001/base/memory/shared_memory_tracker.cc ...
3 years, 10 months ago (2017-02-14 06:33:33 UTC) #55
danakj
That's pretty consistent numbers tho to blame on flake. Are you sure you're measuring correctly ...
3 years, 10 months ago (2017-02-14 16:05:11 UTC) #56
hajimehoshi
On 2017/02/14 16:05:11, danakj wrote: > That's pretty consistent numbers tho to blame on flake. ...
3 years, 10 months ago (2017-02-15 06:30:50 UTC) #57
danakj
On Wed, Feb 15, 2017 at 1:30 AM, <hajimehoshi@chromium.org> wrote: > On 2017/02/14 16:05:11, danakj ...
3 years, 10 months ago (2017-02-15 16:11:34 UTC) #58
hajimehoshi
On Thu, Feb 16, 2017 at 1:11 AM <danakj@chromium.org> wrote: > On Wed, Feb 15, ...
3 years, 10 months ago (2017-02-15 16:30:57 UTC) #59
danakj
On Wed, Feb 15, 2017 at 11:30 AM, Hajime Hoshi <hajimehoshi@chromium.org> wrote: > > On ...
3 years, 10 months ago (2017-02-15 16:34:37 UTC) #60
Primiano Tucci (use gerrit)
On 2017/02/15 16:34:37, danakj wrote: > On Wed, Feb 15, 2017 at 11:30 AM, Hajime ...
3 years, 10 months ago (2017-02-15 16:46:53 UTC) #61
Primiano Tucci (use gerrit)
On 2017/02/15 16:46:53, Primiano Tucci wrote: > On 2017/02/15 16:34:37, danakj wrote: > > On ...
3 years, 10 months ago (2017-02-15 16:48:42 UTC) #62
hajimehoshi
On 2017/02/15 16:48:42, Primiano Tucci wrote: > On 2017/02/15 16:46:53, Primiano Tucci wrote: > > ...
3 years, 10 months ago (2017-02-16 13:34:10 UTC) #63
hajimehoshi
On 2017/02/16 13:34:10, hajimehoshi wrote: > On 2017/02/15 16:48:42, Primiano Tucci wrote: > > On ...
3 years, 10 months ago (2017-02-17 07:34:39 UTC) #64
hajimehoshi
On 2017/02/16 13:34:10, hajimehoshi wrote: > On 2017/02/15 16:48:42, Primiano Tucci wrote: > > On ...
3 years, 10 months ago (2017-02-17 10:07:47 UTC) #65
hajimehoshi
I've started try-perf bots with various number buckets as primiano@ advised. $ ./tools/perf/run_benchmark try linux ...
3 years, 10 months ago (2017-02-20 10:56:51 UTC) #68
Primiano Tucci (use gerrit)
So it seems that we are having some hard time getting stable numbers out of ...
3 years, 10 months ago (2017-02-20 10:59:43 UTC) #69
hajimehoshi
On 2017/02/20 10:56:51, hajimehoshi wrote: > I've started try-perf bots with various number buckets as ...
3 years, 10 months ago (2017-02-21 09:22:03 UTC) #72
danakj
On 2017/02/20 10:59:43, Primiano Tucci wrote: > So it seems that we are having some ...
3 years, 10 months ago (2017-02-22 15:25:47 UTC) #73
danakj
A couple comments from when I had looked before https://codereview.chromium.org/2654073002/diff/140001/base/memory/address_hasher.cc File base/memory/address_hasher.cc (right): https://codereview.chromium.org/2654073002/diff/140001/base/memory/address_hasher.cc#newcode9 base/memory/address_hasher.cc:9: ...
3 years, 10 months ago (2017-02-22 15:28:01 UTC) #74
Primiano Tucci (use gerrit)
On 2017/02/22 at 15:25:47, danakj wrote: > I just am confused why this is being ...
3 years, 10 months ago (2017-02-22 15:30:35 UTC) #75
danakj
On Wed, Feb 22, 2017 at 10:30 AM, <primiano@chromium.org> wrote: > On 2017/02/22 at 15:25:47, ...
3 years, 10 months ago (2017-02-22 15:32:21 UTC) #76
danakj
On 2017/02/20 10:59:43, Primiano Tucci wrote: > So it seems that we are having some ...
3 years, 10 months ago (2017-02-22 15:37:18 UTC) #77
Primiano Tucci (use gerrit)
On 2017/02/22 at 15:37:18, danakj wrote: > On 2017/02/20 10:59:43, Primiano Tucci wrote: > > ...
3 years, 10 months ago (2017-02-22 15:43:06 UTC) #78
danakj
On Wed, Feb 22, 2017 at 10:43 AM, <primiano@chromium.org> wrote: > On 2017/02/22 at 15:37:18, ...
3 years, 10 months ago (2017-02-22 15:54:42 UTC) #79
danakj
On Wed, Feb 22, 2017 at 10:54 AM, <danakj@chromium.org> wrote: > On Wed, Feb 22, ...
3 years, 10 months ago (2017-02-22 15:55:50 UTC) #80
hajimehoshi
On 2017/02/22 15:55:50, danakj wrote: > On Wed, Feb 22, 2017 at 10:54 AM, <mailto:danakj@chromium.org> ...
3 years, 10 months ago (2017-02-22 17:06:33 UTC) #81
hajimehoshi
PTAL https://codereview.chromium.org/2654073002/diff/140001/base/memory/address_hasher.cc File base/memory/address_hasher.cc (right): https://codereview.chromium.org/2654073002/diff/140001/base/memory/address_hasher.cc#newcode9 base/memory/address_hasher.cc:9: size_t AddressHasher::operator()(const void* address) const { On 2017/02/22 ...
3 years, 10 months ago (2017-02-23 07:23:51 UTC) #82
hajimehoshi
On 2017/02/23 07:23:51, hajimehoshi wrote: > PTAL > > https://codereview.chromium.org/2654073002/diff/140001/base/memory/address_hasher.cc > File base/memory/address_hasher.cc (right): > ...
3 years, 10 months ago (2017-02-24 09:43:13 UTC) #87
danakj
https://codereview.chromium.org/2654073002/diff/180001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2654073002/diff/180001/base/memory/shared_memory.h#newcode260 base/memory/shared_memory.h:260: using Id = std::pair<dev_t, ino_t>; one request, lets give ...
3 years, 10 months ago (2017-02-24 15:30:28 UTC) #88
hajimehoshi
Thank you! https://codereview.chromium.org/2654073002/diff/180001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2654073002/diff/180001/base/memory/shared_memory.h#newcode260 base/memory/shared_memory.h:260: using Id = std::pair<dev_t, ino_t>; On 2017/02/24 ...
3 years, 9 months ago (2017-02-27 07:51:55 UTC) #89
Primiano Tucci (use gerrit)
Just some minor comments from my side, defer the rest to Dana's approval. https://codereview.chromium.org/2654073002/diff/200001/base/memory/shared_memory_posix.cc File ...
3 years, 9 months ago (2017-02-27 14:10:51 UTC) #90
hajimehoshi
Thank you! https://codereview.chromium.org/2654073002/diff/200001/base/memory/shared_memory_posix.cc File base/memory/shared_memory_posix.cc (right): https://codereview.chromium.org/2654073002/diff/200001/base/memory/shared_memory_posix.cc#newcode400 base/memory/shared_memory_posix.cc:400: if (fstat(static_cast<int>(handle().fd), &file_stat) != 0) On 2017/02/27 ...
3 years, 9 months ago (2017-02-28 06:59:25 UTC) #91
hajimehoshi
Dana, I found concerns in the current implementation (https://bugs.chromium.org/p/chromium/issues/detail?id=604726#c30) and I'll fix this soon. Please ...
3 years, 9 months ago (2017-02-28 11:00:41 UTC) #92
hajimehoshi
Fixed the whitelist in PRESUBMIT.py. PTAL
3 years, 9 months ago (2017-03-06 06:40:57 UTC) #97
hajimehoshi
3 years, 9 months ago (2017-03-06 06:43:23 UTC) #99
hajimehoshi
+jochen for PRESUBMIT.py
3 years, 9 months ago (2017-03-06 06:43:50 UTC) #100
jochen (gone - plz use gerrit)
lgtm
3 years, 9 months ago (2017-03-06 12:57:59 UTC) #105
danakj
https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc File base/memory/shared_memory_tracker.cc (right): https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc#newcode28 base/memory/shared_memory_tracker.cc:28: AutoLock hold(lock_); can you just put the lock around ...
3 years, 9 months ago (2017-03-06 16:06:04 UTC) #106
danakj
https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory.h#newcode258 base/memory/shared_memory.h:258: #if defined(OS_POSIX) && (!defined(OS_MACOSX) || defined(OS_IOS)) && \ Oh, ...
3 years, 9 months ago (2017-03-06 16:07:06 UTC) #107
hajimehoshi
Thank you! https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory.h File base/memory/shared_memory.h (right): https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory.h#newcode258 base/memory/shared_memory.h:258: #if defined(OS_POSIX) && (!defined(OS_MACOSX) || defined(OS_IOS)) && ...
3 years, 9 months ago (2017-03-07 06:22:34 UTC) #108
danakj
LGTM https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc File base/memory/shared_memory_tracker.cc (right): https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc#newcode31 base/memory/shared_memory_tracker.cc:31: if (!shared_memory.GetUniqueId(&id)) On 2017/03/07 06:22:34, hajimehoshi wrote: > ...
3 years, 9 months ago (2017-03-07 16:14:23 UTC) #113
hajimehoshi
Thank you! https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc File base/memory/shared_memory_tracker.cc (right): https://codereview.chromium.org/2654073002/diff/280001/base/memory/shared_memory_tracker.cc#newcode31 base/memory/shared_memory_tracker.cc:31: if (!shared_memory.GetUniqueId(&id)) On 2017/03/07 16:14:22, danakj wrote: ...
3 years, 9 months ago (2017-03-08 06:11:57 UTC) #114
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/2654073002/320001
3 years, 9 months ago (2017-03-08 06:12:58 UTC) #117
commit-bot: I haz the power
3 years, 9 months ago (2017-03-08 08:56:24 UTC) #120
Message was sent while issue was closed.
Committed patchset #16 (id:320001) as
https://chromium.googlesource.com/chromium/src/+/2acea43a7272838a75e4c6b7e547...

Powered by Google App Engine
This is Rietveld 408576698