New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722418 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug


Participants' hotlists:
Hotlist-4


Sign in to add a comment

Unify logic calculating system-level available memory on ChromeOS

Project Member Reported by teravest@chromium.org, May 15 2017

Issue description

From https://docs.google.com/a/google.com/document/d/1wYHjDHMip88bwC7cN13MmkH_-uABRNBbb_DTYmIPlek/edit?usp=sharing_eip&ts=5914fe39#

There are two separate places where Chrome makes system-level available memory calculations oriented around critical memory pressure:
TabManagerDelegate::MemoryStat::TargetMemoryToFreeKB()
MemoryMonitorChromeOS::GetFreeMemoryUntilCriticalMB()

TargetMemoryToFreeKB() takes min_filelist_kbytes and min_free_kbytes into account while GetFreeMemoryUntilCriticalMB() does not. There's also different treatment of accounting for swap.

We should unify the underlying logic in userspace, and move it to the kernel once an interface is available.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 19 2017

Labels: merge-merged-chromeos-4.4
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c5e451b5021119d25a62b839e7e51951e457c3e6

commit c5e451b5021119d25a62b839e7e51951e457c3e6
Author: Justin TerAvest <teravest@chromium.org>
Date: Fri May 19 23:19:37 2017

CHROMIUM: low-mem: Add "available" sysfs file.

This allows consumers to determine how much memory is "available"
according to the memory pressure calculations performed in the kernel.

This reports available memory in megabytes to use the same units as the
"margin" file in the same directory.

BUG=chromium:722418
TEST=Booted kernel, verified available number looked sane

Signed-off-by: Justin TerAvest <teravest@chromium.org>
Change-Id: Ieb83e70607c0d549fc2291a87f07a5a5534c5c31
Reviewed-on: https://chromium-review.googlesource.com/506768
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>

[modify] https://crrev.com/c5e451b5021119d25a62b839e7e51951e457c3e6/include/linux/low-mem-notify.h
[modify] https://crrev.com/c5e451b5021119d25a62b839e7e51951e457c3e6/mm/low-mem-notify.c

I believe chrome is now using this file, can we mark this fixed?
Status: Fixed (was: Assigned)
Yes I think that this is fixed.
Cc: teravest@chromium.org
Owner: sonnyrao@chromium.org
Status: Assigned (was: Fixed)
re #4 yeah you're right the memory pressure monitor isn't unified, I'm actually working on that part now.
Components: Internals>Core

Sign in to add a comment