Merge "lmkd: Disable memory.stat usage when per-application memcgs are not used"

am: 615745cead

Change-Id: I57f3142ed217d4f1b3edb526087076fc588354d7
This commit is contained in:
Suren Baghdasaryan 2018-08-03 09:14:09 -07:00 committed by android-build-merger
commit 9461708ec9
1 changed files with 4 additions and 1 deletions

View File

@ -115,6 +115,7 @@ static bool low_ram_device;
static bool kill_heaviest_task;
static unsigned long kill_timeout_ms;
static bool use_minfree_levels;
static bool per_app_memcg;
/* data required to handle events */
struct event_handler_info {
@ -481,7 +482,7 @@ static void cmd_procprio(LMKD_CTRL_PACKET packet) {
return;
}
if (low_ram_device) {
if (per_app_memcg) {
if (params.oomadj >= 900) {
soft_limit_mult = 0;
} else if (params.oomadj >= 800) {
@ -1577,6 +1578,8 @@ int main(int argc __unused, char **argv __unused) {
(unsigned long)property_get_int32("ro.lmk.kill_timeout_ms", 0);
use_minfree_levels =
property_get_bool("ro.lmk.use_minfree_levels", false);
per_app_memcg =
property_get_bool("ro.config.per_app_memcg", low_ram_device);
#ifdef LMKD_LOG_STATS
statslog_init(&log_ctx, &enable_stats_log);