summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-08-08 00:52:22 -0700
committerBrian Carlstrom <bdc@google.com>2014-08-08 22:10:06 -0700
commit0378aaf257aee92539d30543914a50c4481c6a18 (patch)
tree6c1e79d1e673f04a5201356eae46d806865db968 /cmds
parentf491f497b2a4ba5a0ec60b291cce4ffb3be3d33c (diff)
downloadframeworks_native-0378aaf257aee92539d30543914a50c4481c6a18.zip
frameworks_native-0378aaf257aee92539d30543914a50c4481c6a18.tar.gz
frameworks_native-0378aaf257aee92539d30543914a50c4481c6a18.tar.bz2
Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup
Bug: 15927194 Change-Id: Id8bc188de68d62fd5f91a99aaaa6c8f2dea06abd
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/commands.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index c25af59..cd53355 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -17,6 +17,7 @@
#include <inttypes.h>
#include <sys/capability.h>
#include "installd.h"
+#include <cutils/sched_policy.h>
#include <diskusage/dirsize.h>
#include <selinux/android.h>
@@ -939,6 +940,10 @@ int dexopt(const char *apk_path, uid_t uid, int is_public,
ALOGE("capset failed: %s\n", strerror(errno));
exit(66);
}
+ if (set_sched_policy(0, SP_BACKGROUND) < 0) {
+ ALOGE("set_sched_policy failed: %s\n", strerror(errno));
+ exit(70);
+ }
if (flock(out_fd, LOCK_EX | LOCK_NB) != 0) {
ALOGE("flock(%s) failed: %s\n", out_path, strerror(errno));
exit(67);