summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2015-10-26 12:21:01 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-10-26 12:21:01 +0000
commit5157212f42fcf90a2ce136b795c092bbffd41d54 (patch)
treefa948a8cac353b5cebb7040ff8202ac80768e323
parent6fea45816ae5ce22b9f186a1fc4b447a42ece10f (diff)
parentfd6bb2d486084a0eeeb11767b17234cf4a23159d (diff)
downloadextras-5157212f42fcf90a2ce136b795c092bbffd41d54.tar.gz
Merge "Reduce oom_score_adj to zero for perfprofd."
-rw-r--r--perfprofd/perfprofdcore.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/perfprofd/perfprofdcore.cc b/perfprofd/perfprofdcore.cc
index 3fb532c1..d9ed2b03 100644
--- a/perfprofd/perfprofdcore.cc
+++ b/perfprofd/perfprofdcore.cc
@@ -828,6 +828,15 @@ static void init(ConfigReader &config)
config.getConfigFilePath());
}
+ // Children of init inherit an artificially low OOM score -- this is not
+ // desirable for perfprofd (its OOM score should be on par with
+ // other user processes).
+ std::stringstream oomscore_path;
+ oomscore_path << "/proc/" << getpid() << "/oom_score_adj";
+ if (!android::base::WriteStringToFile("0", oomscore_path.str())) {
+ W_ALOGE("unable to write to %s", oomscore_path.str().c_str());
+ }
+
set_seed(config);
cleanup_destination_dir(config);