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

Issue 2857283002: Add memory pressure listener to Blob storage (Closed)

Created:
3 years, 7 months ago by ssid
Modified:
3 years, 7 months ago
Reviewers:
Ilya Sherman, dmurph
CC:
chromium-reviews, asvitkine+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add memory pressure listener to Blob storage This CL adds a memory pressure listener to blob storage memory controller and evicts the blob items to disk on pressure. The evictions are throttled to 30seconds to avoid thrashing disk. Records histograms of sizes evicted with reasons. BUG=715859 Review-Url: https://codereview.chromium.org/2857283002 Cr-Commit-Position: refs/heads/master@{#471189} Committed: https://chromium.googlesource.com/chromium/src/+/b26c3a43ba0a153e42639400d53ded106f5791a9

Patch Set 1 : . #

Patch Set 2 : fix #

Patch Set 3 : add test. #

Patch Set 4 : set limit in constants. #

Total comments: 7

Patch Set 5 : ratio and pressue arg. #

Total comments: 8

Patch Set 6 : Rename constant, use base::Uma function and add base attribute. #

Patch Set 7 : Rename constant, use base::Uma function and add base attribute. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -16 lines) Patch
M storage/browser/blob/blob_memory_controller.h View 1 2 3 4 6 chunks +16 lines, -3 lines 0 comments Download
M storage/browser/blob/blob_memory_controller.cc View 1 2 3 4 5 12 chunks +70 lines, -13 lines 0 comments Download
M storage/browser/blob/blob_memory_controller_unittest.cc View 1 2 3 4 5 6 4 chunks +49 lines, -0 lines 0 comments Download
M storage/common/blob_storage/blob_storage_constants.h View 1 2 3 4 5 6 2 chunks +8 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 2 chunks +17 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 52 (35 generated)
ssid
PTAL thanks
3 years, 7 months ago (2017-05-04 21:14:28 UTC) #17
dmurph
On 2017/05/04 21:14:28, ssid wrote: > PTAL thanks This is awesome, I'd like to take ...
3 years, 7 months ago (2017-05-05 03:38:40 UTC) #18
ssid
On 2017/05/05 03:38:40, dmurph wrote: > On 2017/05/04 21:14:28, ssid wrote: > > PTAL thanks ...
3 years, 7 months ago (2017-05-05 18:05:05 UTC) #19
dmurph
On 2017/05/05 18:05:05, ssid wrote: > On 2017/05/05 03:38:40, dmurph wrote: > > On 2017/05/04 ...
3 years, 7 months ago (2017-05-05 19:39:16 UTC) #20
ssid
> We basically schedule a bunch of tasks to save memory to disk. We don't ...
3 years, 7 months ago (2017-05-06 00:57:59 UTC) #21
ssid
I forgot to mention, the memory pressure listeners are replaced with memory coordinator clients, which ...
3 years, 7 months ago (2017-05-06 01:46:17 UTC) #22
dmurph
On 2017/05/06 00:57:59, ssid wrote: > > We basically schedule a bunch of tasks to ...
3 years, 7 months ago (2017-05-09 21:52:29 UTC) #23
dmurph
https://codereview.chromium.org/2857283002/diff/120001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2857283002/diff/120001/storage/browser/blob/blob_memory_controller.cc#newcode511 storage/browser/blob/blob_memory_controller.cc:511: base::Unretained(this))), Unretained? How is this being registered? Can we ...
3 years, 7 months ago (2017-05-09 21:57:33 UTC) #24
ssid
> I... I don't think so. We don't keep this anywhere other than refcounts.... > ...
3 years, 7 months ago (2017-05-10 00:21:38 UTC) #25
dmurph
lgtm with nits. If you disagree w/ constant rename let me know. https://codereview.chromium.org/2857283002/diff/120001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc ...
3 years, 7 months ago (2017-05-10 19:13:34 UTC) #27
ssid
+isherman for histograms.xml change. ptal Thanks
3 years, 7 months ago (2017-05-11 19:31:44 UTC) #29
Ilya Sherman
Metrics LGTM % comments: https://codereview.chromium.org/2857283002/diff/140001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2857283002/diff/140001/storage/browser/blob/blob_memory_controller.cc#newcode940 storage/browser/blob/blob_memory_controller.cc:940: base::HistogramBase::kUmaTargetedHistogramFlag); Please use one of ...
3 years, 7 months ago (2017-05-11 20:13:40 UTC) #30
ssid
Made the changes suggested, Thanks. https://codereview.chromium.org/2857283002/diff/140001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2857283002/diff/140001/storage/browser/blob/blob_memory_controller.cc#newcode888 storage/browser/blob/blob_memory_controller.cc:888: On 2017/05/10 19:13:34, dmurph ...
3 years, 7 months ago (2017-05-12 01:38:01 UTC) #42
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/2857283002/200001
3 years, 7 months ago (2017-05-12 02:21:31 UTC) #47
commit-bot: I haz the power
Committed patchset #7 (id:200001) as https://chromium.googlesource.com/chromium/src/+/b26c3a43ba0a153e42639400d53ded106f5791a9
3 years, 7 months ago (2017-05-12 02:28:59 UTC) #50
Marijn Kruisselbrink
On 2017/05/12 at 02:28:59, commit-bot wrote: > Committed patchset #7 (id:200001) as https://chromium.googlesource.com/chromium/src/+/b26c3a43ba0a153e42639400d53ded106f5791a9 The unit ...
3 years, 7 months ago (2017-05-22 20:22:01 UTC) #51
ssid
3 years, 7 months ago (2017-05-22 20:25:35 UTC) #52
Message was sent while issue was closed.
On 2017/05/22 20:22:01, Marijn Kruisselbrink wrote:
> On 2017/05/12 at 02:28:59, commit-bot wrote:
> > Committed patchset #7 (id:200001) as
>
https://chromium.googlesource.com/chromium/src/+/b26c3a43ba0a153e42639400d53d...
> 
> The unit test added in this CL appears to be flaky:
>
https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_T...
> 
> [ RUN      ] BlobMemoryControllerTest.OnMemoryPressure
> ../../storage/browser/blob/blob_memory_controller_unittest.cc:1159: Failure
> Value of: file_runner_->HasPendingTask()
>   Actual: false
> Expected: true
> ../../storage/browser/blob/blob_memory_controller_unittest.cc:1167: Failure
>       Expected: 1u
>       Which is: 1
> To be equal to: controller.memory_usage()
>       Which is: 5
> ../../storage/browser/blob/blob_memory_controller_unittest.cc:1168: Failure
>       Expected: size_to_load - 1
>       Which is: 4
> To be equal to: controller.disk_usage()
>       Which is: 0
> [  FAILED  ] BlobMemoryControllerTest.OnMemoryPressure (0 ms)

Thanks for posting,
Can you please file a bug? I can look at it in some time.

Powered by Google App Engine
This is Rietveld 408576698