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

Issue 114923005: base: Discardable memory types. (Closed)

Created:
7 years ago by reveman
Modified:
6 years, 11 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, gavinp+memory_chromium.org, Jeffrey Yasskin
Visibility:
Public.

Description

base: Discardable memory types. This adds a DiscardableMemoryType enum and a function that can be used to select what type of discardable memory to use. This is generally useful for debugging purposes and when evaluating the performance of one implementation vs another. The unit test framework for discardable memory is improved slightly by testing every supported type on each platform rather then just the one specific type. Furthermore, it allows us to expose ashmem based discardable memory on ChromeOS in about:flags before we make it default. No change in behavior unless the new --use-discardable-memory=type switch is used. BUG=327516 TEST=base_unitttest --gtest_filter=DiscardableMemory* TBR=tomhudson@google.com Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=243532

Patch Set 1 #

Total comments: 26

Patch Set 2 : address review feedback #

Total comments: 8

Patch Set 3 : add discardable memory type name #

Patch Set 4 : add missing include #

Total comments: 24

Patch Set 5 : address review feedback #

Total comments: 3

Patch Set 6 : address review feedback #

Patch Set 7 : rebase #

Patch Set 8 : fix macosx build issues #

Total comments: 2

Patch Set 9 : Add switches::kUseDiscardableMemory to kForwardSwitches #

Unified diffs Side-by-side diffs Delta from patch set Stats (+407 lines, -129 lines) Patch
M base/base.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M base/memory/discardable_memory.h View 1 2 3 4 5 3 chunks +42 lines, -13 lines 0 comments Download
A base/memory/discardable_memory.cc View 1 2 3 4 5 1 chunk +85 lines, -0 lines 0 comments Download
M base/memory/discardable_memory_allocator_android.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_android.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_android.cc View 1 2 3 4 5 6 3 chunks +32 lines, -9 lines 0 comments Download
M base/memory/discardable_memory_emulated.h View 1 1 chunk +1 line, -1 line 0 comments Download
M base/memory/discardable_memory_emulated.cc View 1 1 chunk +5 lines, -4 lines 0 comments Download
M base/memory/discardable_memory_linux.cc View 1 2 3 4 5 1 chunk +28 lines, -10 lines 0 comments Download
M base/memory/discardable_memory_mac.cc View 1 2 3 4 5 6 7 4 chunks +70 lines, -40 lines 0 comments Download
M base/memory/discardable_memory_provider_unittest.cc View 1 10 chunks +17 lines, -15 lines 0 comments Download
M base/memory/discardable_memory_unittest.cc View 1 2 3 4 5 6 7 4 chunks +58 lines, -18 lines 0 comments Download
M base/memory/discardable_memory_win.cc View 1 2 3 4 5 1 chunk +28 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/login/chrome_restart_request.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 1 chunk +23 lines, -0 lines 0 comments Download
M skia/ext/SkDiscardableMemory_chrome.cc View 1 5 1 chunk +3 lines, -3 lines 0 comments Download
M webkit/child/web_discardable_memory_impl.cc View 1 5 1 chunk +3 lines, -3 lines 0 comments Download
M webkit/child/webkitplatformsupport_child_impl.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 25 (0 generated)
reveman
https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory.h#newcode19 base/memory/discardable_memory.h:19: DISCARDABLE_MEMORY_ANDROID, Follow up patches will replace this with DISCARDABLE_MEMORY_ASHMEM, ...
7 years ago (2013-12-13 18:21:53 UTC) #1
reveman
More discardable memory refactor. This is particularly useful for upcoming use of ashmem on ChromeOS, ...
7 years ago (2013-12-16 21:05:51 UTC) #2
Philippe
Thanks David! This looks mostly good to me. I only have one main comment on ...
7 years ago (2013-12-17 14:28:21 UTC) #3
Philippe
https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory_android.cc File base/memory/discardable_memory_android.cc (right): https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory_android.cc#newcode269 base/memory/discardable_memory_android.cc:269: if (!memory->Initialize()) On 2013/12/17 14:28:21, Philippe wrote: > I ...
7 years ago (2013-12-17 15:26:22 UTC) #4
reveman
PTAL https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/114923005/diff/1/base/memory/discardable_memory.cc#newcode1 base/memory/discardable_memory.cc:1: // Copyright (c) 2013 The Chromium Authors. All ...
7 years ago (2013-12-18 08:12:38 UTC) #5
Philippe
Thanks David! I like what you did with the vector of supported types. LGTM since ...
7 years ago (2013-12-18 09:07:46 UTC) #6
willchan no longer on Chromium
I'm in classes today and tomorrow. I'll try to sneak some review time in between. ...
7 years ago (2013-12-18 16:42:50 UTC) #7
reveman
https://codereview.chromium.org/114923005/diff/20001/base/memory/discardable_memory.h File base/memory/discardable_memory.h (right): https://codereview.chromium.org/114923005/diff/20001/base/memory/discardable_memory.h#newcode65 base/memory/discardable_memory.h:65: // Get system supported discardable memory types. Preferred type ...
7 years ago (2013-12-18 19:44:25 UTC) #8
willchan no longer on Chromium
Mostly just had nits. https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc#newcode38 base/memory/discardable_memory.cc:38: for (size_t i = 0; ...
7 years ago (2013-12-24 01:21:06 UTC) #9
reveman
PTAL https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc#newcode38 base/memory/discardable_memory.cc:38: for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTypeNamePairs); ...
6 years, 12 months ago (2013-12-26 11:46:08 UTC) #10
willchan no longer on Chromium
+jyasskin (Jeffrey, can you look at https://codereview.chromium.org/114923005/diff/270001/base/memory/discardable_memory.cc#newcode63 when you get a chance?) Let's not block ...
6 years, 12 months ago (2013-12-26 18:25:53 UTC) #11
Jeffrey Yasskin
https://codereview.chromium.org/114923005/diff/270001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/114923005/diff/270001/base/memory/discardable_memory.cc#newcode63 base/memory/discardable_memory.cc:63: subtle::AtomicWord value = subtle::Acquire_Load(&g_default_type); On 2013/12/26 18:25:54, willchan wrote: ...
6 years, 12 months ago (2013-12-26 18:36:07 UTC) #12
reveman
PTAL https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc File base/memory/discardable_memory.cc (right): https://codereview.chromium.org/114923005/diff/60001/base/memory/discardable_memory.cc#newcode58 base/memory/discardable_memory.cc:58: g_discardable_memory_type.Get().value = type; On 2013/12/26 18:25:54, willchan wrote: ...
6 years, 12 months ago (2013-12-26 21:53:34 UTC) #13
willchan no longer on Chromium
lgtm
6 years, 11 months ago (2014-01-06 23:45:16 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/114923005/480001
6 years, 11 months ago (2014-01-06 23:55:27 UTC) #15
commit-bot: I haz the power
Failed to apply patch for base/memory/discardable_memory_android.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2014-01-06 23:55:33 UTC) #16
reveman
need some owner reviews, +piman for content/ changes +tomhudson for skia/ rubberstamp +jamesr for webkit/ ...
6 years, 11 months ago (2014-01-07 04:19:14 UTC) #17
Tom Hudson
Skia rubberstamp LGTM. Didn't know you'd be visiting this week!
6 years, 11 months ago (2014-01-07 12:29:26 UTC) #18
jamesr
lgtm
6 years, 11 months ago (2014-01-07 18:09:56 UTC) #19
piman
content/ LGTM + one thing. https://codereview.chromium.org/114923005/diff/440002/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/114923005/diff/440002/content/browser/renderer_host/render_process_host_impl.cc#newcode1072 content/browser/renderer_host/render_process_host_impl.cc:1072: switches::kUseDiscardableMemory, Can you add ...
6 years, 11 months ago (2014-01-08 01:42:22 UTC) #20
reveman
https://codereview.chromium.org/114923005/diff/440002/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/114923005/diff/440002/content/browser/renderer_host/render_process_host_impl.cc#newcode1072 content/browser/renderer_host/render_process_host_impl.cc:1072: switches::kUseDiscardableMemory, On 2014/01/08 01:42:23, piman (OOO back 2014-1-7) wrote: ...
6 years, 11 months ago (2014-01-08 03:05:25 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/114923005/790001
6 years, 11 months ago (2014-01-08 03:05:52 UTC) #22
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=43676
6 years, 11 months ago (2014-01-08 03:23:05 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/reveman@chromium.org/114923005/790001
6 years, 11 months ago (2014-01-08 05:33:39 UTC) #24
commit-bot: I haz the power
6 years, 11 months ago (2014-01-08 12:27:40 UTC) #25
Message was sent while issue was closed.
Change committed as 243532

Powered by Google App Engine
This is Rietveld 408576698