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

Issue 2743253006: [Mac] Return cached pressure level in GetCurrentPressureLevel(). (Closed)

Created:
3 years, 9 months ago by shrike
Modified:
3 years, 7 months ago
Reviewers:
Mark Mentovai, lgrey, brettw
CC:
chromium-reviews, mac-reviews_chromium.org, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Return cached pressure level in GetCurrentPressureLevel(). MemoryPressureMonitor clients call GetCurrentPressureLevel(), sometimes frequently, to get the current memory pressure reading. Up until recently the cached memory pressure level could be very stale, so we updated it on every call to GetCurrentPressureLevel(). Now that the memory pressure level is updated regularly, we can just return the cached value (and avoid the extra syscalls). R=lgrey@chromium.org,mark@chromium.org BUG=701408 Review-Url: https://codereview.chromium.org/2743253006 Cr-Commit-Position: refs/heads/master@{#456890} Committed: https://chromium.googlesource.com/chromium/src/+/f53f979ccc20eac06865022a612910ae510e796c

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -15 lines) Patch
M base/memory/memory_pressure_monitor_mac.cc View 1 chunk +0 lines, -1 line 0 comments Download
M base/memory/memory_pressure_monitor_mac_unittest.cc View 3 chunks +12 lines, -14 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
shrike
PTAL
3 years, 9 months ago (2017-03-14 17:17:25 UTC) #1
lgrey
LGTM (but note that I'm not yet a committer)
3 years, 9 months ago (2017-03-14 17:23:02 UTC) #2
shrike
PTAL (for owners approval)
3 years, 9 months ago (2017-03-14 21:11:46 UTC) #4
Mark Mentovai
LGTM
3 years, 9 months ago (2017-03-14 21:40:17 UTC) #5
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/2743253006/1
3 years, 9 months ago (2017-03-14 22:37:51 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/f53f979ccc20eac06865022a612910ae510e796c
3 years, 9 months ago (2017-03-14 23:35:06 UTC) #11
brettw
This change introduces a race condition and I think is incorrect. The last_pressure_level_ is driven ...
3 years, 7 months ago (2017-05-10 20:46:50 UTC) #13
shrike
On 2017/05/10 20:46:50, brettw (behind--catching up) wrote: > This change introduces a race condition and ...
3 years, 7 months ago (2017-05-10 20:55:47 UTC) #14
brettw
On 2017/05/10 20:55:47, shrike wrote: > On 2017/05/10 20:46:50, brettw (behind--catching up) wrote: > > ...
3 years, 7 months ago (2017-05-10 21:00:34 UTC) #15
shrike
3 years, 7 months ago (2017-05-10 21:06:31 UTC) #16
Message was sent while issue was closed.
On 2017/05/10 21:00:34, brettw (behind--catching up) wrote:
> > OK, I will prepare a cl for that.
> 
> I *think* all this might need is to update the cached value from the OS
> notification.

Yes, that was my thought as well.

Powered by Google App Engine
This is Rietveld 408576698