From: Brian Carlstrom Date: Fri, 8 Aug 2014 07:52:22 +0000 (-0700) Subject: Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0378aaf257aee92539d30543914a50c4481c6a18;p=android-x86%2Fframeworks-native.git Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup Bug: 15927194 Change-Id: Id8bc188de68d62fd5f91a99aaaa6c8f2dea06abd --- diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index c25af59e34..cd533551b0 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -17,6 +17,7 @@ #include #include #include "installd.h" +#include #include #include @@ -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);