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

Issue 2518273003: [Blink Heap] Move isLowEndDevice to Memory Coordinator, attempt #3 (Closed)

Created:
4 years, 1 month ago by whywhat
Modified:
4 years ago
Reviewers:
haraken, sof
CC:
Mads Ager (chromium), blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, kouhei+heap_chromium.org, loading-reviews+fetch_chromium.org, oilpan-reviews, tyoshino+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Blink Heap] Move isLowEndDevice to Memory Coordinator, attempt #3 A preparation for https://codereview.chromium.org/2475293003 to be able to override this from tests. Had to go with a static method approach. Seems like hanging it off the heap allocated object breaks blink_heap_unittests on Mac and Windows (see https://codereview.chromium.org/2503433003 and https://codereview.chromium.org/2510353005). BUG=None TEST=Run the blink_heap_unittests locally (on Linux). Committed: https://crrev.com/caab7202c6ecbbaf5caa71be51e7c1d061606f35 Cr-Commit-Position: refs/heads/master@{#434027}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -9 lines) Patch
M third_party/WebKit/Source/core/fetch/MemoryCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/MemoryCoordinator.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/MemoryCoordinator.cpp View 3 chunks +7 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/platform/heap/Heap.h View 2 chunks +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/Heap.cpp View 3 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.cpp View 3 chunks +3 lines, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (10 generated)
whywhat
PTAL
4 years, 1 month ago (2016-11-22 18:03:48 UTC) #2
sof
lgtm, but the description of a commit should describe what it does, and not much ...
4 years, 1 month ago (2016-11-22 19:12:03 UTC) #6
haraken
LGTM
4 years, 1 month ago (2016-11-22 23:12:36 UTC) #9
whywhat
On 2016/11/22 at 19:12:03, sigbjornf wrote: > lgtm, but the description of a commit should ...
4 years, 1 month ago (2016-11-22 23:39:24 UTC) #11
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/2518273003/1
4 years, 1 month ago (2016-11-22 23:40:08 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 1 month ago (2016-11-22 23:54:47 UTC) #15
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/caab7202c6ecbbaf5caa71be51e7c1d061606f35 Cr-Commit-Position: refs/heads/master@{#434027}
4 years, 1 month ago (2016-11-22 23:57:54 UTC) #17
sof
On 2016/11/22 23:39:24, whywhat wrote: > On 2016/11/22 at 19:12:03, sigbjornf wrote: > > lgtm, ...
4 years, 1 month ago (2016-11-23 06:18:09 UTC) #18
whywhat
On 2016/11/23 at 06:18:09, sigbjornf wrote: > On 2016/11/22 23:39:24, whywhat wrote: > > On ...
4 years ago (2016-11-23 18:29:42 UTC) #19
sof
On 2016/11/23 18:29:42, whywhat wrote: > On 2016/11/23 at 06:18:09, sigbjornf wrote: > > On ...
4 years ago (2016-11-23 19:25:08 UTC) #20
whywhat
4 years ago (2016-11-23 20:40:39 UTC) #21
Message was sent while issue was closed.
On 2016/11/23 at 19:25:08, sigbjornf wrote:
> On 2016/11/23 18:29:42, whywhat wrote:
> > On 2016/11/23 at 06:18:09, sigbjornf wrote:
> > > On 2016/11/22 23:39:24, whywhat wrote:
> > > > On 2016/11/22 at 19:12:03, sigbjornf wrote:
> > > > > lgtm, but the description of a commit should describe what it does,
and
> > not
> > > > much more - the mention of previous CLs that didn't work out, aren't
that
> > > > interesting for someone looking later.
> > > > 
> > > > I feel they are relevant because they explain why the static method was
> > chosen
> > > > (esp. since I'm going to add overriding mechanism later on).
> > > > Added a clarification to the description.
> > > > 
> > > 
> > 
> > Let me try to understand this better so I could improve :)
> > 
> > > The description is unfocused (and badly formatted);
> > 
> > I take 'badly formatted' is because one sentence is longer than 72 chars so
it
> > looks bad in git log? I admit it's my bad.
> > I'd take constructive criticism for the "unfocused" part. What would you
write?
> > 
> > > target doesn't matter
> > > here (see the initial comment on why the NestedAllocation test failing.)
> > 
> > Do you mean static vs. non-static member by "target"?
> > 
> 
> No, Mac and Windows - the underlying problems could show up on any
target/platform, depending on GC timing and heap state.
> 
> > IIRC, you mentioned two possible causes for the failures: extra heap
allocation
> > during the test and the test being non-thread-safe.
> 
> Yes, the failures highlighted two problems afaict
> 
>  - a unit test that happens to trigger a GC
>      => touches the heap-allocated singleton for the first time when it sweeps
>       => brings about extra allocations
>        => skews the heap size counting that the test depends on.
> 
>  - service worker tests that access the main thread heap's
MemoryCoordinator::instance() object after the heap has shut down. 
> 
> > I wasn't able to confirm these though because the tests passed locally for
me.
> > 
> 
> Stepping through the code to either come up with or verify semi-plausible
theories for seemingly non-deterministic GC issues, is sometimes all there is.
> 
> Running the unit tests in single-process mode might have elicited the first
problem..not sure.
> 
> > > 
> > > The initial approach you went with wasn't complete, so mentioning
> > > those is rather uninteresting.
> > 
> > By 'complete' do you mean that I could've fixed the failing tests?
> > 
> 
> Not 'complete' in that didn't consider the (non-obvious) implications of using
a main thread heap object from inside the Oilpan GC.
> 
> > ----------------------------------------------------
> > 
> > My view was that someone may stumble upon the static method in the future
and
> > think, "hey, why don't we make it non-static and hang it off the already
static
> > MC instance". Well, if they look at this change, they will find out it was
tried
> > already and what were the obstacles by reading through the comments on the
> > previous CLs.
> 
> If the description had said "This replaces an approach which used
MC::instance(), because..", they'd be informed. Or you could have put a comment
next to the static predicate to hint why it is kept separate.

Thanks for your patient replies! I will add a comment in the follow-up CL that I
have in the queue.

Powered by Google App Engine
This is Rietveld 408576698