summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcutils/sched_policy.c2
-rw-r--r--rootdir/init.rc9
2 files changed, 10 insertions, 1 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 6d905898a..05a20481d 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -404,7 +404,7 @@ int set_sched_policy(int tid, SchedPolicy policy)
}
- if (fd > 0 && add_tid_to_cgroup(tid, fd) != 0) {
+ if (add_tid_to_cgroup(tid, fd) != 0) {
if (errno != ESRCH && errno != ENOENT)
return -errno;
}
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 7dc9e5509..df60f6582 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -145,6 +145,15 @@ on init
write /dev/cpuctl/cpu.rt_period_us 1000000
write /dev/cpuctl/cpu.rt_runtime_us 950000
+ mkdir /dev/cpuctl/bg_non_interactive
+ chown system system /dev/cpuctl/bg_non_interactive/tasks
+ chmod 0666 /dev/cpuctl/bg_non_interactive/tasks
+ # 5.0 %
+ write /dev/cpuctl/bg_non_interactive/cpu.shares 52
+ write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000
+ # active FIFO threads will never be in BG
+ write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 10000
+
# sets up initial cpusets for ActivityManager
mkdir /dev/cpuset
mount cpuset none /dev/cpuset