diff options
author | Brian Carlstrom <bdc@google.com> | 2014-08-08 00:52:22 -0700 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-08-11 18:31:03 +0100 |
commit | 3b14e5b1f3fd1f3ef66696dc7ce4e53b6af3c309 (patch) | |
tree | 245655a196e070e52708463dea4ed62f46951a7c /cmds | |
parent | 7d1cd4aae2aa42172abdff00ec1601248cf92b02 (diff) | |
download | frameworks_native-3b14e5b1f3fd1f3ef66696dc7ce4e53b6af3c309.zip frameworks_native-3b14e5b1f3fd1f3ef66696dc7ce4e53b6af3c309.tar.gz frameworks_native-3b14e5b1f3fd1f3ef66696dc7ce4e53b6af3c309.tar.bz2 |
Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup
Bug: 15927194
(cherry picked from commit 0378aaf257aee92539d30543914a50c4481c6a18)
Change-Id: I462b5ac256c4d091ed4023cf4b97dd6a4abcaa5f
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index bd721c8..f05ce61 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> @@ -950,6 +951,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); |