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

Issue 1320493006: Oilpan: Add a RELEASE_ASSERT to catch out-of-virtual-address-space errors (Closed)

Created:
5 years, 3 months ago by haraken
Modified:
5 years, 3 months ago
Reviewers:
keishi, sof
CC:
blink-reviews, haraken, oilpan-reviews, kouhei+heap_chromium.org, Mads Ager (chromium)
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Oilpan: Add a RELEASE_ASSERT to catch out-of-virtual-address-space errors Currently we run into an infinite loop when we hit the limit of the number of mmapped regions OS can support. It is better to have a RELEASE_ASSERT about it. BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201892

Patch Set 1 #

Patch Set 2 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -3 lines) Patch
M Source/platform/heap/HeapPage.cpp View 1 3 chunks +7 lines, -3 lines 5 comments Download

Messages

Total messages: 12 (3 generated)
haraken
PTAL
5 years, 3 months ago (2015-09-08 00:53:12 UTC) #2
keishi
LGTM
5 years, 3 months ago (2015-09-08 02:34:27 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1320493006/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1320493006/20001
5 years, 3 months ago (2015-09-08 04:20:06 UTC) #5
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=201892
5 years, 3 months ago (2015-09-08 05:00:10 UTC) #6
sof
https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp File Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp#newcode552 Source/platform/heap/HeapPage.cpp:552: RELEASE_ASSERT(numberOfTrials < 64); Could you explain a bit more ...
5 years, 3 months ago (2015-09-08 05:30:34 UTC) #8
haraken
https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp File Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp#newcode552 Source/platform/heap/HeapPage.cpp:552: RELEASE_ASSERT(numberOfTrials < 64); On 2015/09/08 05:30:34, sof wrote: > ...
5 years, 3 months ago (2015-09-08 05:35:19 UTC) #9
sof
lgtm https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp File Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp#newcode552 Source/platform/heap/HeapPage.cpp:552: RELEASE_ASSERT(numberOfTrials < 64); On 2015/09/08 05:35:19, haraken wrote: ...
5 years, 3 months ago (2015-09-08 06:25:57 UTC) #10
haraken
https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp File Source/platform/heap/HeapPage.cpp (right): https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/HeapPage.cpp#newcode552 Source/platform/heap/HeapPage.cpp:552: RELEASE_ASSERT(numberOfTrials < 64); On 2015/09/08 06:25:57, sof wrote: > ...
5 years, 3 months ago (2015-09-08 06:33:15 UTC) #11
sof
5 years, 3 months ago (2015-09-08 06:59:17 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/He...
File Source/platform/heap/HeapPage.cpp (right):

https://codereview.chromium.org/1320493006/diff/20001/Source/platform/heap/He...
Source/platform/heap/HeapPage.cpp:552: RELEASE_ASSERT(numberOfTrials < 64);
On 2015/09/08 06:33:14, haraken wrote:
> On 2015/09/08 06:25:57, sof wrote:
> > On 2015/09/08 05:35:19, haraken wrote:
> > > On 2015/09/08 05:30:34, sof wrote:
> > > > Could you explain a bit more what you were seeing? The PageMemoryRegion
> was
> > > able
> > > > to allocate (and not OOMedly crash), but something failed when setting
up
> > the
> > > > region?
> > > 
> > > The above memory->commit() starts failing (because mprotect fails) after
we
> > map
> > > more than 65530 (/proc/sys/vm/max_map_count) regions.
> > > 
> > 
> > And once it does & that OS' limit is reached, the remaining blink pages will
> not
> > be committed.
> > 
> > I suppose a different way to handle it is to catch if all commit()s fail for
a
> > region. But once we hit this resource exhausted state, a few more of these
> loop
> > iterations won't make much of a difference.
> 
> Right.
> 
> BTW, do you have any idea on why we have a 'while (!pageMemory)' loop? I guess
> it's somehow related to threading race, but I don't understand why it's
needed.
> 
> Also maybe can we just RELEASE_ASSERT once the first memory->commit() fails? I
> don't think it fails (except for the out-of-virtual-memory scenario).

Yes, it looks out of place to have a loop there now.

  http://codereview.chromium.org/393823003

added it for the purposes of repeatedly polling the cross-thread-usable free
page pool (after having filled it up with the pages of a new region.) As we now
take the first page & don't add that to the pool, the loop looks redundant.

Powered by Google App Engine
This is Rietveld 408576698