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

Issue 195863005: Use DiscardableMemoryManager on Android. (Closed)

Created:
6 years, 9 months ago by Philippe
Modified:
6 years, 7 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, gavinp+memory_chromium.org
Visibility:
Public.

Description

Use DiscardableMemoryManager on Android. This allows userspace (DiscardableMemoryManager) to control eviction of unlocked DiscardableMemory instances to prevent the process from running out of address space in cases of heavy use of unlocked DiscardableMemory. This also removes all the occurences of 'Android' from the ashmem allocator to allow it to be later used on ChromeOS. BUG=327516, 334996 R=reveman@chromium.org, willchan@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267170

Patch Set 1 : Rename allocator to DiscardableMemoryAllocationAshmemFactory #

Patch Set 2 : Use DiscardableMemoryController on Android #

Total comments: 3

Patch Set 3 : Fix nits #

Patch Set 4 : Override similarity percentage to detect file renames #

Patch Set 5 : Fix nits #

Total comments: 8

Patch Set 6 : Address David's comments #

Patch Set 7 : Rebase on r266174 #

Patch Set 8 : Fix base.gypi #

Total comments: 22

Patch Set 9 : Address David's comments #

Patch Set 10 : Fix DiscardableMemoryAshmem + enable unit test on Android that exposes the bug #

Total comments: 9

Patch Set 11 : Fix compilation issues on non-Android platforms #

Total comments: 2

Patch Set 12 : Address David's comments #

Patch Set 13 : Revert unnecessary diff in Mac implementation #

Total comments: 1

Patch Set 14 : Revert unnecessary addition of logging.h include in discardable_memory_unittest.cc #

Patch Set 15 : Add |DiscardableMemoryAshmem::is_locked| #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -1181 lines) Patch
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -1 line 2 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -2 lines 0 comments Download
M base/memory/discardable_memory.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -5 lines 0 comments Download
M base/memory/discardable_memory.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_allocator_android.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -70 lines 0 comments Download
M base/memory/discardable_memory_allocator_android.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -553 lines 0 comments Download
M base/memory/discardable_memory_allocator_android_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -303 lines 0 comments Download
M base/memory/discardable_memory_android.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +26 lines, -16 lines 0 comments Download
A + base/memory/discardable_memory_ashmem.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +21 lines, -15 lines 0 comments Download
A base/memory/discardable_memory_ashmem.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +75 lines, -0 lines 0 comments Download
A + base/memory/discardable_memory_ashmem_allocator.h View 1 2 3 4 5 6 7 8 2 chunks +47 lines, -24 lines 0 comments Download
A + base/memory/discardable_memory_ashmem_allocator.cc View 1 2 3 4 5 6 7 8 15 chunks +63 lines, -89 lines 0 comments Download
A + base/memory/discardable_memory_ashmem_allocator_unittest.cc View 1 2 3 4 5 6 7 8 12 chunks +85 lines, -69 lines 0 comments Download
M base/memory/discardable_memory_emulated.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M base/memory/discardable_memory_emulated.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -5 lines 0 comments Download
M base/memory/discardable_memory_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -6 lines 0 comments Download
M base/memory/discardable_memory_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +1 line, -6 lines 0 comments Download
M base/memory/discardable_memory_manager.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_manager.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_manager_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +1 line, -5 lines 0 comments Download
M base/memory/discardable_memory_win.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -6 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
Philippe
https://codereview.chromium.org/195863005/diff/20001/base/memory/discardable_memory_manager.cc File base/memory/discardable_memory_manager.cc (right): https://codereview.chromium.org/195863005/diff/20001/base/memory/discardable_memory_manager.cc#newcode123 base/memory/discardable_memory_manager.cc:123: it->second.allocation->Unlock(); FYI: I need to do a rebase here.
6 years, 9 months ago (2014-03-20 17:10:14 UTC) #1
reveman
I think the file names should be discardable_memory_allocation_ashmem.h/cc to be consistent with existing code. For ...
6 years, 9 months ago (2014-03-20 19:33:43 UTC) #2
Philippe
https://codereview.chromium.org/195863005/diff/20001/base/base.gypi File base/base.gypi (right): https://codereview.chromium.org/195863005/diff/20001/base/base.gypi#newcode798 base/base.gypi:798: ['OS == "android" and _toolset == "target"', { On ...
6 years, 9 months ago (2014-03-21 10:17:44 UTC) #3
Philippe
PTAL :) I will update the CL's description once I'm sure the approach looks reasonable ...
6 years, 8 months ago (2014-04-25 15:51:58 UTC) #4
reveman
https://chromiumcodereview.appspot.com/195863005/diff/180001/base/memory/discardable_memory_allocator_android.h File base/memory/discardable_memory_allocator_android.h (right): https://chromiumcodereview.appspot.com/195863005/diff/180001/base/memory/discardable_memory_allocator_android.h#newcode58 base/memory/discardable_memory_allocator_android.h:58: // On Android ashmem is used to implement discardable ...
6 years, 8 months ago (2014-04-26 00:13:37 UTC) #5
Philippe
Thanks David for the review, PTAL. After reconsideration I really think that it's both simpler ...
6 years, 7 months ago (2014-04-28 12:23:14 UTC) #6
Philippe
On 2014/04/28 12:23:14, Philippe wrote: > Thanks David for the review, PTAL. > > After ...
6 years, 7 months ago (2014-04-28 14:49:21 UTC) #7
Philippe
PTAL :)
6 years, 7 months ago (2014-04-28 15:26:05 UTC) #8
reveman
https://chromiumcodereview.appspot.com/195863005/diff/180001/base/memory/discardable_memory_allocator_android.h File base/memory/discardable_memory_allocator_android.h (right): https://chromiumcodereview.appspot.com/195863005/diff/180001/base/memory/discardable_memory_allocator_android.h#newcode64 base/memory/discardable_memory_allocator_android.h:64: class BASE_EXPORT_PRIVATE DiscardableMemoryAllocator { On 2014/04/28 12:23:14, Philippe wrote: ...
6 years, 7 months ago (2014-04-28 15:39:16 UTC) #9
Philippe
Thanks David! I will upload a new patch set shortly to address the compilation issue ...
6 years, 7 months ago (2014-04-28 15:53:45 UTC) #10
reveman
https://chromiumcodereview.appspot.com/195863005/diff/250001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://chromiumcodereview.appspot.com/195863005/diff/250001/base/memory/discardable_memory.h#newcode120 base/memory/discardable_memory.h:120: static bool PurgeForTestingSupported(DiscardableMemoryType type); On 2014/04/28 15:53:45, Philippe wrote: ...
6 years, 7 months ago (2014-04-28 16:02:24 UTC) #11
Philippe
https://chromiumcodereview.appspot.com/195863005/diff/250001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://chromiumcodereview.appspot.com/195863005/diff/250001/base/memory/discardable_memory.h#newcode124 base/memory/discardable_memory.h:124: static void PurgeForTesting(DiscardableMemoryType type); On 2014/04/28 16:02:24, reveman wrote: ...
6 years, 7 months ago (2014-04-28 16:31:21 UTC) #12
reveman
lgtm
6 years, 7 months ago (2014-04-28 17:13:33 UTC) #13
Philippe
Thanks David! I'm adding William for the approval.
6 years, 7 months ago (2014-04-28 17:34:21 UTC) #14
pliard
On 2014/04/28 17:34:21, Philippe wrote: > Thanks David! I'm adding William for the approval. Ping ...
6 years, 7 months ago (2014-04-29 19:02:27 UTC) #15
willchan no longer on Chromium
Reviewing this made me feel pretty happy about the refactoring y'all are doing here. It ...
6 years, 7 months ago (2014-04-30 06:38:20 UTC) #16
Philippe
Thanks William! I agree that the re-entrancy happening in DiscardableMemoryAshmem and DiscardableMemoryEmulated through the manager ...
6 years, 7 months ago (2014-04-30 08:38:09 UTC) #17
Philippe
The CQ bit was checked by pliard@chromium.org
6 years, 7 months ago (2014-04-30 08:39:45 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/195863005/340001
6 years, 7 months ago (2014-04-30 08:40:07 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 08:43:56 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium
6 years, 7 months ago (2014-04-30 08:43:56 UTC) #21
Philippe
The CQ bit was checked by pliard@chromium.org
6 years, 7 months ago (2014-04-30 08:47:40 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/195863005/340001
6 years, 7 months ago (2014-04-30 08:48:18 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-30 08:53:32 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium
6 years, 7 months ago (2014-04-30 08:53:32 UTC) #25
Philippe
Committed patchset #15 manually as r267170 (presubmit successful).
6 years, 7 months ago (2014-04-30 10:54:47 UTC) #26
henrika (OOO until Aug 14)
A revert of this CL has been created in https://codereview.chromium.org/264633002/ by henrika@chromium.org. The reason for ...
6 years, 7 months ago (2014-04-30 11:06:26 UTC) #27
Nikita (slow)
6 years, 7 months ago (2014-04-30 11:08:30 UTC) #28
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/260673003/ by nkostylev@chromium.org.

The reason for reverting is: Fails compile

http://goo.gl/qePAC4.

Powered by Google App Engine
This is Rietveld 408576698