merge in jb-release history after reset to jb-dev
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index e03ce00..d20d217 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -63,8 +63,6 @@
#if CAN_SET_SP_SYSTEM
static int system_cgroup_fd = -1;
#endif
-static int audio_app_cgroup_fd = -1;
-static int audio_sys_cgroup_fd = -1;
/* Add tid to the scheduling group defined by the policy */
static int add_tid_to_cgroup(int tid, SchedPolicy policy)
@@ -76,6 +74,8 @@
fd = bg_cgroup_fd;
break;
case SP_FOREGROUND:
+ case SP_AUDIO_APP:
+ case SP_AUDIO_SYS:
fd = fg_cgroup_fd;
break;
#if CAN_SET_SP_SYSTEM
@@ -83,12 +83,6 @@
fd = system_cgroup_fd;
break;
#endif
- case SP_AUDIO_APP:
- fd = audio_app_cgroup_fd;
- break;
- case SP_AUDIO_SYS:
- fd = audio_sys_cgroup_fd;
- break;
default:
fd = -1;
break;
@@ -137,30 +131,17 @@
}
#endif
- filename = "/dev/cpuctl/foreground/tasks";
+ filename = "/dev/cpuctl/apps/tasks";
fg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
if (fg_cgroup_fd < 0) {
SLOGE("open of %s failed: %s\n", filename, strerror(errno));
}
- filename = "/dev/cpuctl/bg_non_interactive/tasks";
+ filename = "/dev/cpuctl/apps/bg_non_interactive/tasks";
bg_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
if (bg_cgroup_fd < 0) {
SLOGE("open of %s failed: %s\n", filename, strerror(errno));
}
-
- filename = "/dev/cpuctl/audio_app/tasks";
- audio_app_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
- if (audio_app_cgroup_fd < 0) {
- SLOGV("open of %s failed: %s\n", filename, strerror(errno));
- }
-
- filename = "/dev/cpuctl/audio_sys/tasks";
- audio_sys_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
- if (audio_sys_cgroup_fd < 0) {
- SLOGV("open of %s failed: %s\n", filename, strerror(errno));
- }
-
} else {
__sys_supports_schedgroups = 0;
}
@@ -253,14 +234,10 @@
return -1;
if (grpBuf[0] == '\0') {
*policy = SP_SYSTEM;
- } else if (!strcmp(grpBuf, "bg_non_interactive")) {
+ } else if (!strcmp(grpBuf, "apps/bg_non_interactive")) {
*policy = SP_BACKGROUND;
- } else if (!strcmp(grpBuf, "foreground")) {
+ } else if (!strcmp(grpBuf, "apps")) {
*policy = SP_FOREGROUND;
- } else if (!strcmp(grpBuf, "audio_app")) {
- *policy = SP_AUDIO_APP;
- } else if (!strcmp(grpBuf, "audio_sys")) {
- *policy = SP_AUDIO_SYS;
} else {
errno = ERANGE;
return -1;
@@ -319,17 +296,13 @@
SLOGD("vvv tid %d (%s)", tid, thread_name);
break;
case SP_FOREGROUND:
+ case SP_AUDIO_APP:
+ case SP_AUDIO_SYS:
SLOGD("^^^ tid %d (%s)", tid, thread_name);
break;
case SP_SYSTEM:
SLOGD("/// tid %d (%s)", tid, thread_name);
break;
- case SP_AUDIO_APP:
- SLOGD("aaa tid %d (%s)", tid, thread_name);
- break;
- case SP_AUDIO_SYS:
- SLOGD("sss tid %d (%s)", tid, thread_name);
- break;
default:
SLOGD("??? tid %d (%s)", tid, thread_name);
break;
diff --git a/rootdir/init.rc b/rootdir/init.rc
index aa1bb92..2305572 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -93,34 +93,20 @@
write /dev/cpuctl/cpu.rt_runtime_us 950000
write /dev/cpuctl/cpu.rt_period_us 1000000
- mkdir /dev/cpuctl/foreground
- chown system system /dev/cpuctl/foreground/tasks
- chmod 0666 /dev/cpuctl/foreground/tasks
- write /dev/cpuctl/foreground/cpu.shares 1024
- write /dev/cpuctl/foreground/cpu.rt_runtime_us 100000
- write /dev/cpuctl/foreground/cpu.rt_period_us 1000000
+ mkdir /dev/cpuctl/apps
+ chown system system /dev/cpuctl/apps/tasks
+ chmod 0666 /dev/cpuctl/apps/tasks
+ write /dev/cpuctl/apps/cpu.shares 1024
+ write /dev/cpuctl/apps/cpu.rt_runtime_us 800000
+ write /dev/cpuctl/apps/cpu.rt_period_us 1000000
- mkdir /dev/cpuctl/bg_non_interactive
- chown system system /dev/cpuctl/bg_non_interactive/tasks
- chmod 0666 /dev/cpuctl/bg_non_interactive/tasks
+ mkdir /dev/cpuctl/apps/bg_non_interactive
+ chown system system /dev/cpuctl/apps/bg_non_interactive/tasks
+ chmod 0666 /dev/cpuctl/apps/bg_non_interactive/tasks
# 5.0 %
- write /dev/cpuctl/bg_non_interactive/cpu.shares 52
- write /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us 100000
- write /dev/cpuctl/bg_non_interactive/cpu.rt_period_us 1000000
-
- mkdir /dev/cpuctl/audio_app
- chown system system /dev/cpuctl/audio_app/tasks
- chmod 0660 /dev/cpuctl/audio_app/tasks
- write /dev/cpuctl/audio_app/cpu.shares 10
- write /dev/cpuctl/audio_app/cpu.rt_runtime_us 100000
- write /dev/cpuctl/audio_app/cpu.rt_period_us 1000000
-
- mkdir /dev/cpuctl/audio_sys
- chown system system /dev/cpuctl/audio_sys/tasks
- chmod 0660 /dev/cpuctl/audio_sys/tasks
- write /dev/cpuctl/audio_sys/cpu.shares 10
- write /dev/cpuctl/audio_sys/cpu.rt_runtime_us 100000
- write /dev/cpuctl/audio_sys/cpu.rt_period_us 1000000
+ write /dev/cpuctl/apps/bg_non_interactive/cpu.shares 52
+ write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_runtime_us 700000
+ write /dev/cpuctl/apps/bg_non_interactive/cpu.rt_period_us 1000000
# Allow everybody to read the xt_qtaguid resource tracking misc dev.
# This is needed by any process that uses socket tagging.