summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot2018-08-03 11:07:24 -0500
committerGerrit Code Review2018-08-03 11:07:24 -0500
commit615745cead3d368b974f468efd6545e87f74b474 (patch)
tree3f4861856683e6c0ddac7cebaedca1d6b09b39c7
parenta02ca9e7ae2706d8c82759829ffe9c96e87d7adf (diff)
parentce13cb52fe7e64a74b79a164cd7953db32a95983 (diff)
downloadplatform-system-core-615745cead3d368b974f468efd6545e87f74b474.tar.gz
platform-system-core-615745cead3d368b974f468efd6545e87f74b474.tar.xz
platform-system-core-615745cead3d368b974f468efd6545e87f74b474.zip
Merge "lmkd: Disable memory.stat usage when per-application memcgs are not used"
-rw-r--r--lmkd/lmkd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index c2487d62d..e7c13e0c8 100644
--- a/lmkd/lmkd.c
+++ b/lmkd/lmkd.c
@@ -111,6 +111,7 @@ static bool low_ram_device;
111static bool kill_heaviest_task; 111static bool kill_heaviest_task;
112static unsigned long kill_timeout_ms; 112static unsigned long kill_timeout_ms;
113static bool use_minfree_levels; 113static bool use_minfree_levels;
114static bool per_app_memcg;
114 115
115/* data required to handle events */ 116/* data required to handle events */
116struct event_handler_info { 117struct event_handler_info {
@@ -472,7 +473,7 @@ static void cmd_procprio(LMKD_CTRL_PACKET packet) {
472 return; 473 return;
473 } 474 }
474 475
475 if (low_ram_device) { 476 if (per_app_memcg) {
476 if (params.oomadj >= 900) { 477 if (params.oomadj >= 900) {
477 soft_limit_mult = 0; 478 soft_limit_mult = 0;
478 } else if (params.oomadj >= 800) { 479 } else if (params.oomadj >= 800) {
@@ -1481,6 +1482,8 @@ int main(int argc __unused, char **argv __unused) {
1481 (unsigned long)property_get_int32("ro.lmk.kill_timeout_ms", 0); 1482 (unsigned long)property_get_int32("ro.lmk.kill_timeout_ms", 0);
1482 use_minfree_levels = 1483 use_minfree_levels =
1483 property_get_bool("ro.lmk.use_minfree_levels", false); 1484 property_get_bool("ro.lmk.use_minfree_levels", false);
1485 per_app_memcg =
1486 property_get_bool("ro.config.per_app_memcg", low_ram_device);
1484 1487
1485 if (!init()) { 1488 if (!init()) {
1486 if (!use_inkernel_interface) { 1489 if (!use_inkernel_interface) {