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

Issue 1332583002: Architecture for cross-process memory notification suppressing (Closed)

Created:
5 years, 3 months ago by petrcermak
Modified:
5 years, 3 months ago
CC:
chromium-reviews, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, yurys, darin-cc_chromium.org, devtools-reviews_chromium.org, pfeldman, rmcilroy
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Architecture for cross-process memory notification suppressing This patch adds IPC architecture for suppressing memory pressure notifications in all processes: BROWSER PROCESS CHILD PROCESSES MemoryPressureListener:: MemoryPressureListener:: SetNotificationsSuppressed SetNotificationsSuppressed (existing static method*) (existing static method*) ^ ^ | | +--------------------------+ | | MemoryPressureController | | +..> | (singleton) | | : +--------------------------+ | : | | : V | : +--------------------------+ +--------------------------+ : | MemoryMessageFilter | <===> | ChildMemoryMessageFilter | : | (per child process) | IPC | (singleton) | : +--------------------------+ +--------------------------+ : : +.. Memory.setPressureNotificationsSuppressed (proposed DevTools API**) *) The required functionality for individual processes was added in: https://codereview.chromium.org/1312163003. **) The new DevTools API will be added in the following 3-sided patch: https://codereview.chromium.org/1336363002, https://codereview.chromium.org/1311343007, and https://codereview.chromium.org/1342833004. This patch adds new message filters on both sides (MemoryMessageFilter in the browser process and ChildMemoryMessageFilter in the child process) because we anticipate more functionality to be added to MemoryPressureController in the near future (methods for simulating memory pressure signals and, more importantly, propagating memory pressure signals to all processes on desktop Chrome). Encapsulating the relevant IPC communication in dedicated message filters is arguably better than keeping augmenting (and having duplicate code in) BrowserChildProcessHostImpl, RenderProcessHostImpl, and ChildThreadImpl. This patch represents the second step towards implementing a DevTools API for suppressing and simulating memory pressure signals in Chrome. The main use case for this feature is to enforce consistent conditions across memory measurements. See https://goo.gl/cZFdH3 for more details. BUG=516776 Committed: https://crrev.com/0b119f3392d6c6169bbb792347a04f34ce649156 Cr-Commit-Position: refs/heads/master@{#350169}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Update for review feedback #

Patch Set 3 : Split patch #

Total comments: 10

Patch Set 4 : Address primiano's comments & add tests #

Patch Set 5 : Remove unnecessary includes #

Total comments: 10

Patch Set 6 : Address nasko's comments #

Total comments: 8

Patch Set 7 : Address primiano's comments & rebase #

Patch Set 8 : Final rebase #

Patch Set 9 : Add CONTENT_EXPORT to be able to link tests in component builds #

Patch Set 10 : Don't leak IPC::Message in browser test #

Patch Set 11 : Add comment explaining the use of scoped_ptr in the browser test matcher #

Unified diffs Side-by-side diffs Delta from patch set Stats (+423 lines, -2 lines) Patch
M content/browser/browser_child_process_host_impl.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
A content/browser/memory/memory_message_filter.h View 1 2 3 4 5 6 7 8 1 chunk +35 lines, -0 lines 0 comments Download
A content/browser/memory/memory_message_filter.cc View 1 2 3 4 1 chunk +34 lines, -0 lines 0 comments Download
A content/browser/memory/memory_pressure_controller.h View 1 2 3 4 5 6 7 8 1 chunk +48 lines, -0 lines 0 comments Download
A content/browser/memory/memory_pressure_controller.cc View 1 2 3 4 5 6 1 chunk +71 lines, -0 lines 0 comments Download
A content/browser/memory/memory_pressure_controller_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +131 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
A content/child/memory/child_memory_message_filter.h View 1 2 3 4 5 1 chunk +32 lines, -0 lines 0 comments Download
A content/child/memory/child_memory_message_filter.cc View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
M content/common/content_message_generator.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A content/common/memory_messages.h View 1 2 3 4 5 6 7 8 1 chunk +22 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M content/content_child.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M ipc/ipc_message_start.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (13 generated)
petrcermak
Hi, this is a prototype of the cross-process memory notification suppressing architecture we discussed yesterday. ...
5 years, 3 months ago (2015-09-08 13:45:00 UTC) #3
Sami
Looks pretty good. Same comment about naming as in the Blink patch. https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc File content/browser/devtools/protocol/memory_handler.cc ...
5 years, 3 months ago (2015-09-08 18:06:56 UTC) #4
petrcermak
https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc File content/browser/devtools/protocol/memory_handler.cc (right): https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc#newcode22 content/browser/devtools/protocol/memory_handler.cc:22: return Response::OK(); On 2015/09/08 18:06:56, Sami wrote: > Is ...
5 years, 3 months ago (2015-09-11 10:43:50 UTC) #5
Sami
https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc File content/browser/devtools/protocol/memory_handler.cc (right): https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc#newcode22 content/browser/devtools/protocol/memory_handler.cc:22: return Response::OK(); On 2015/09/11 10:43:50, petrcermak wrote: > On ...
5 years, 3 months ago (2015-09-11 11:37:42 UTC) #6
petrcermak
Thanks for your comments. PTAL. Petr https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc File content/browser/devtools/protocol/memory_handler.cc (right): https://codereview.chromium.org/1332583002/diff/20001/content/browser/devtools/protocol/memory_handler.cc#newcode22 content/browser/devtools/protocol/memory_handler.cc:22: return Response::OK(); On ...
5 years, 3 months ago (2015-09-14 12:46:22 UTC) #7
Sami
Thanks, I think looks like a great foundation to build on.
5 years, 3 months ago (2015-09-14 17:02:22 UTC) #8
Primiano Tucci (use gerrit)
Looks a great start and I love the ascii art wrapped at 72 cols. Some ...
5 years, 3 months ago (2015-09-16 09:11:50 UTC) #9
petrcermak
Thanks for your comments. PTAL. Petr https://codereview.chromium.org/1332583002/diff/60001/content/browser/memory/memory_message_filter.cc File content/browser/memory/memory_message_filter.cc (right): https://codereview.chromium.org/1332583002/diff/60001/content/browser/memory/memory_message_filter.cc#newcode41 content/browser/memory/memory_message_filter.cc:41: void MemoryMessageFilter::OnSetPressureNotificationsSuppressedAck() { ...
5 years, 3 months ago (2015-09-16 18:14:26 UTC) #10
petrcermak
nasko: Hi, could you please review this patch? Thanks, Petr
5 years, 3 months ago (2015-09-16 18:15:09 UTC) #12
nasko
I have an overall architectural question - Why do we need these message filters at ...
5 years, 3 months ago (2015-09-16 21:18:37 UTC) #13
petrcermak
Thanks for all your comments. PTAL. Regarding your architectural question, there are two reasons why ...
5 years, 3 months ago (2015-09-17 15:24:53 UTC) #15
nasko
Please add a bit to the CL description saying that the message filter approach is ...
5 years, 3 months ago (2015-09-17 16:53:03 UTC) #16
Primiano Tucci (use gerrit)
LGTM with some comments. Many thanks for the nice commit message (I especially appreciate the ...
5 years, 3 months ago (2015-09-17 18:23:50 UTC) #17
petrcermak
Thanks for all your comments. chrisha: Hi, could you please have a quick look at ...
5 years, 3 months ago (2015-09-18 10:19:12 UTC) #19
petrcermak
+cc rmcilroy
5 years, 3 months ago (2015-09-18 15:45:05 UTC) #20
chrisha
> chrisha: Hi, could you please have a quick look at this? I just want ...
5 years, 3 months ago (2015-09-21 15:26:16 UTC) #21
petrcermak
On 2015/09/21 15:26:16, chrisha wrote: > > chrisha: Hi, could you please have a quick ...
5 years, 3 months ago (2015-09-22 08:56:47 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332583002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332583002/180001
5 years, 3 months ago (2015-09-22 09:12:53 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win8_chromium_ng/builds/43766)
5 years, 3 months ago (2015-09-22 09:40:25 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332583002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332583002/200001
5 years, 3 months ago (2015-09-22 13:38:09 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/55973)
5 years, 3 months ago (2015-09-22 14:26:34 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1332583002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1332583002/240001
5 years, 3 months ago (2015-09-22 14:46:42 UTC) #35
commit-bot: I haz the power
Committed patchset #11 (id:240001)
5 years, 3 months ago (2015-09-22 16:25:54 UTC) #36
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/0b119f3392d6c6169bbb792347a04f34ce649156 Cr-Commit-Position: refs/heads/master@{#350169}
5 years, 3 months ago (2015-09-22 16:26:38 UTC) #37
huangs
A revert of this CL (patchset #11 id:240001) has been created in https://codereview.chromium.org/1359873002/ by huangs@chromium.org. ...
5 years, 3 months ago (2015-09-22 16:53:59 UTC) #38
Primiano Tucci (use gerrit)
5 years, 3 months ago (2015-09-22 16:58:43 UTC) #39
Message was sent while issue was closed.
On 2015/09/22 16:53:59, huangs wrote:
> A revert of this CL (patchset #11 id:240001) has been created in
> https://codereview.chromium.org/1359873002/ by mailto:huangs@chromium.org.
> 
> The reason for reverting is: This seems to cause failure in Cast Linux:
> content_browsertests:
>
MemoryPressureControllerBrowserTest.SetPressureNotificationsSuppressedInAllProcesses.

Link to the failing bot? Isn't there coverage on the CQ for Cast?

Powered by Google App Engine
This is Rietveld 408576698