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

Issue 2130683002: [Experiment] purge-and-suspend

Created:
4 years, 5 months ago by tasak
Modified:
4 years, 4 months ago
Reviewers:
haraken, esprehn, sof, bashi
CC:
Mads Ager (chromium), blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-style_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, jam, Nate Chapin, kinuko+watch, kouhei+heap_chromium.org, loading-reviews+fetch_chromium.org, mlamouri+watch-content_chromium.org, oilpan-reviews, rwlbuis, sof, telemetry-reviews_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Experiment] purge-and-suspend BUG= CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 #

Total comments: 13

Patch Set 2 : WIP #

Patch Set 3 : Updated #

Total comments: 28
Unified diffs Side-by-side diffs Delta from patch set Stats (+712 lines, -48 lines) Patch
M cc/raster/staging_buffer_pool.h View 3 chunks +4 lines, -0 lines 0 comments Download
M cc/raster/staging_buffer_pool.cc View 3 chunks +14 lines, -0 lines 2 comments Download
M cc/resources/resource_pool.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M cc/resources/resource_pool.cc View 1 2 3 chunks +11 lines, -0 lines 2 comments Download
M cc/tiles/gpu_image_decode_controller.h View 3 chunks +6 lines, -0 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller.cc View 3 chunks +9 lines, -0 lines 0 comments Download
M cc/tiles/software_image_decode_controller.h View 3 chunks +6 lines, -0 lines 0 comments Download
M cc/tiles/software_image_decode_controller.cc View 3 chunks +11 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp View 1 2 chunks +14 lines, -2 lines 6 comments Download
M third_party/WebKit/Source/core/dom/PendingScript.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/PendingScript.cpp View 1 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.cpp View 1 1 chunk +8 lines, -0 lines 4 comments Download
M third_party/WebKit/Source/core/fetch/CachedMetadataHandler.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FontResource.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FontResource.cpp View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCache.cpp View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 4 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ScriptResource.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ScriptResource.cpp View 1 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/DOMWindow.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 1 chunk +15 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/OverflowModel.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.h View 1 3 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 1 2 6 chunks +15 lines, -20 lines 2 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp View 1 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/paint/PaintInfo.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/blink_platform.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontPlatformData.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp View 1 1 chunk +6 lines, -0 lines 2 comments Download
M third_party/WebKit/Source/platform/fonts/SimpleFontData.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp View 1 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.cpp View 1 2 2 chunks +2 lines, -6 lines 2 comments Download
M third_party/WebKit/Source/platform/text/CompressibleString.h View 3 chunks +7 lines, -3 lines 2 comments Download
M third_party/WebKit/Source/platform/text/CompressibleString.cpp View 6 chunks +48 lines, -11 lines 4 comments Download
M third_party/WebKit/Source/web/WebMemoryCoordinator.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M tools/perf/benchmarks/memory_infra.py View 1 2 chunks +33 lines, -0 lines 0 comments Download
A tools/perf/page_sets/memory_test.py View 1 1 chunk +369 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (16 generated)
tasak
4 years, 5 months ago (2016-07-07 07:05:41 UTC) #4
haraken
The purging targets look good to me (at least as a starting point). Let's discuss ...
4 years, 5 months ago (2016-07-07 09:12:25 UTC) #5
tasak
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp File third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp (left): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp#oldcode40 third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp:40: WTF::Partitions::decommitFreeableMemory(); On 2016/07/07 09:12:25, haraken wrote: > > Where ...
4 years, 5 months ago (2016-07-07 09:30:59 UTC) #6
sof
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1204 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204: discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); Why drop the check for ...
4 years, 5 months ago (2016-07-07 09:35:19 UTC) #8
tasak
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1204 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204: discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); On 2016/07/07 09:35:19, sof wrote: ...
4 years, 5 months ago (2016-07-08 03:56:45 UTC) #9
bashi
Yeah, let's discuss later how we should trigger these purging logic. https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/web/WebMemoryCoordinator.cpp File third_party/WebKit/Source/web/WebMemoryCoordinator.cpp (right): ...
4 years, 5 months ago (2016-07-08 04:16:23 UTC) #10
tasak
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/web/WebMemoryCoordinator.cpp File third_party/WebKit/Source/web/WebMemoryCoordinator.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/web/WebMemoryCoordinator.cpp#newcode25 third_party/WebKit/Source/web/WebMemoryCoordinator.cpp:25: WTF::Partitions::decommitFreeableMemory(); On 2016/07/08 04:16:22, bashi1 wrote: > I think ...
4 years, 5 months ago (2016-07-08 06:47:23 UTC) #11
bashi
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/web/WebMemoryCoordinator.cpp File third_party/WebKit/Source/web/WebMemoryCoordinator.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/web/WebMemoryCoordinator.cpp#newcode25 third_party/WebKit/Source/web/WebMemoryCoordinator.cpp:25: WTF::Partitions::decommitFreeableMemory(); On 2016/07/08 06:47:23, tasak wrote: > On 2016/07/08 ...
4 years, 5 months ago (2016-07-08 07:09:09 UTC) #12
sof
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1204 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204: discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); On 2016/07/08 03:56:45, tasak wrote: ...
4 years, 5 months ago (2016-07-08 07:14:30 UTC) #13
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-19 03:15:43 UTC) #16
tasak
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1204 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204: discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); On 2016/07/08 07:14:29, sof wrote: ...
4 years, 5 months ago (2016-07-19 08:22:51 UTC) #19
haraken
https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/2130683002/diff/1/third_party/WebKit/Source/platform/heap/HeapPage.cpp#newcode1204 third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204: discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); On 2016/07/19 08:22:51, tasak wrote: ...
4 years, 5 months ago (2016-07-19 20:20:22 UTC) #20
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-20 03:42:39 UTC) #23
commit-bot: I haz the power
Your CL relies on deprecated CQ feature(s): * Specifying master names in CQ_INCLUDE_TRYBOTS part of ...
4 years, 5 months ago (2016-07-20 03:54:48 UTC) #27
tasak
Hi esprehn, Would you review this CL from the viewpoint of what should be purged ...
4 years, 5 months ago (2016-07-20 08:10:54 UTC) #31
esprehn
On 2016/07/20 at 08:10:54, tasak wrote: > Hi esprehn, > > Would you review this ...
4 years, 4 months ago (2016-08-02 00:34:08 UTC) #32
esprehn
Where is the suspend part? You hook up a bunch of this stuff to the ...
4 years, 4 months ago (2016-08-05 23:00:58 UTC) #33
esprehn
Hmm the CompressibleString code doesn't make any sense to me, we only have CompressibleStrings on ...
4 years, 4 months ago (2016-08-05 23:06:27 UTC) #34
haraken
On 2016/08/05 23:06:27, esprehn wrote: > Hmm the CompressibleString code doesn't make any sense to ...
4 years, 4 months ago (2016-08-08 03:55:47 UTC) #35
tasak
4 years, 4 months ago (2016-08-08 04:47:37 UTC) #36
Thank you, esprehn.

Currently we are planning purge-and-suspend without CompressibleString.
"suspend" feature has been already implemented by hajimehoshi@. I will use the
code.

https://codereview.chromium.org/2130683002/diff/60001/cc/raster/staging_buffe...
File cc/raster/staging_buffer_pool.cc (right):

https://codereview.chromium.org/2130683002/diff/60001/cc/raster/staging_buffe...
cc/raster/staging_buffer_pool.cc:200: base::allocator::ReleaseFreeMemory();
On 2016/08/05 23:00:57, esprehn wrote:
> is this is very strange inside the cc/raster code... why would
StagingBufferPool
> call into base::allocator? If we're supposed to do this the MemoryCoordinator
> should do it for you automatically after calling the OnMemoryPressure
callbacks

Acknowledged.

Yeah, I agree that MemoryCoordinator should do. Since we have no
MemoryCoordinator, I temporarily added tons of
base::allocator::ReleaseFreeMemory(). I will revert the bad
base::allocator::ReleaseFreeMemory() calls.

https://codereview.chromium.org/2130683002/diff/60001/cc/resources/resource_p...
File cc/resources/resource_pool.cc (right):

https://codereview.chromium.org/2130683002/diff/60001/cc/resources/resource_p...
cc/resources/resource_pool.cc:305: base::allocator::ReleaseFreeMemory();
On 2016/08/05 23:00:57, esprehn wrote:
> yeah...

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp:41:
memoryCache()->pruneAll();
On 2016/08/05 23:00:57, esprehn wrote:
> Would it be possible to independently hook up these sub systems instead of
> making this one know about every feature in the engine?

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp:47:
CompressibleStringImpl::compressAll();
On 2016/08/05 23:00:58, esprehn wrote:
> hmm without suspend doing this is pretty bad, it means v8 is going to cause
them
> to uncompress really soon. Did we solve that yet?

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/MemoryCoordinator.cpp:48: } else {
On 2016/08/05 23:00:57, esprehn wrote:
> else if

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/dom/StyleEngine.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/StyleEngine.cpp:817: clearResolver();
On 2016/08/05 23:00:58, esprehn wrote:
> I think this has some scary side effects, you should double check with rune@,
> this also leaves all of the ScopedStyleResolvers. It's going to make us recalc
> the entire document I think too.

Acknowledged.

I would like to ask one thing. Are you talking about "background to foreground"
full recalc?
As far as I understand, background tabs are suspended and need no layout, no
stylerecalc, and no painting.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/StyleEngine.cpp:819:
m_sheetToTextCache.clear();
On 2016/08/05 23:00:58, esprehn wrote:
> This code doesn't really make sense, you're leaving around all of the
> ScopedStyleResolvers and the CSSStyleSheet which were created from these
> strings. Are you sure this actually saves memory? It shouldn't, the cache here
> is just for looking up stuff the rest of the DOM is already using

Acknowledged.
I agree that basically these caches' sizes are small and that the impact is very
small.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/frame/FrameView.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/frame/FrameView.cpp:4307:
rootGraphicsLayer->getPaintController().invalidateAll();
On 2016/08/05 23:00:58, esprehn wrote:
> This is only the main graphics layer, what about all of the other ones? Are we
> sure this does the right thing?

I see. I would like to traverse all children and to invoke their
paintController's "invalidateAll()".

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/page/Page.cpp (left):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/page/Page.cpp:334: if (m_visibilityState ==
PageVisibilityStateHidden) {
On 2016/08/05 23:00:58, esprehn wrote:
> is this actually enabled today?

No, not enabled. I manually applied compressibleString patch.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp:352:
m_harfBuzzFace = nullptr;
On 2016/08/05 23:00:58, esprehn wrote:
> Are we sure this is safe? drott@'s comments on the other patch make it sound
bad

Acknowledged.
I think, drott@ is reducing tons of font memory. He has already reduced what I
pointed out.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/heap/HeapPage.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/heap/HeapPage.cpp:1204:
discardPages(startOfGap + sizeof(FreeListEntry), headerAddress);
On 2016/08/05 23:00:58, esprehn wrote:
> Why is it okay to remove the LowEndDevice comments and checks?

I don't want to remove the "if" and the comment. This is just for checking
whether the code affects resident_set_bytes or PSS or private_dirty or not.

I will revert the change when we are doing some experiment.
Instead, MemoryCoordinator will discard such unused pages if required.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/text/CompressibleString.cpp (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/text/CompressibleString.cpp:119: in =
std::string(reinterpret_cast<const char*>(m_string.characters8()),
originalContentSizeInBytes());
On 2016/08/05 23:00:58, esprehn wrote:
> ouch this is pretty bad it doubles the memory usage of the huge JS strings
while
> we're in the process of compressing them.

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/text/CompressibleString.cpp:148:
compression::GzipUncompress(in, &out);
On 2016/08/05 23:00:58, esprehn wrote:
> ditto

Acknowledged.

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/platform/text/CompressibleString.h (right):

https://codereview.chromium.org/2130683002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/platform/text/CompressibleString.h:77: unsigned
m_compressedDataSize;
On 2016/08/05 23:00:58, esprehn wrote:
> we should probably do this separately. I'm also concerned about the complexity
> the current system causes because it assumes JS can run and force an
uncompress.
> What if we instead hide the compression the DOM?

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698