summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren Baghdasaryan2018-06-19 20:38:12 -0500
committerSuren Baghdasaryan2018-08-03 11:06:54 -0500
commitce13cb52fe7e64a74b79a164cd7953db32a95983 (patch)
tree3f4861856683e6c0ddac7cebaedca1d6b09b39c7
parenta02ca9e7ae2706d8c82759829ffe9c96e87d7adf (diff)
downloadplatform-system-core-ce13cb52fe7e64a74b79a164cd7953db32a95983.tar.gz
platform-system-core-ce13cb52fe7e64a74b79a164cd7953db32a95983.tar.xz
platform-system-core-ce13cb52fe7e64a74b79a164cd7953db32a95983.zip
lmkd: Disable memory.stat usage when per-application memcgs are not used
Per-application memory.stat files are not available when per-application memcgs are not used (per_app_memcg=false). Disable its usage based on ro.config.per_app_memcg property. minchan: * correct indentation of memory_stat_parse * move per_app_memcg check into memory_stat_parse inside * change low_ram_device to per_app_memcg Bug: 110384555 Test: manual test to see lkmd log message with memory hogger Merged-In: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a Change-Id: Ib6dd7586d3ef1c64cb04d16e2d2b21fa9c8e6a3a Signed-off-by: Minchan Kim <minchan@google.com> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
-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) {