diff options
author | Riley Andrews <riandrews@google.com> | 2014-10-08 20:51:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-08 20:51:48 +0000 |
commit | d1380d645de163d34a6e590f82eb0ee40d51f408 (patch) | |
tree | c49289bf95db73962aa1f34324a2133da55ae2d9 /libcutils | |
parent | c496e02c399d5fe963e6036fe2bd2bdb2a85d8aa (diff) | |
parent | 33b335495c7b8eea4b9af13a7157cf83cd085129 (diff) | |
download | system_core-d1380d645de163d34a6e590f82eb0ee40d51f408.zip system_core-d1380d645de163d34a6e590f82eb0ee40d51f408.tar.gz system_core-d1380d645de163d34a6e590f82eb0ee40d51f408.tar.bz2 |
am 33b33549: Merge "Make the default cgroup, the foreground cgroup." into lmp-mr1-dev
* commit '33b335495c7b8eea4b9af13a7157cf83cd085129':
Make the default cgroup, the foreground cgroup.
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/sched_policy.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index d3cedd4..e07bbbd 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c @@ -45,8 +45,6 @@ static inline SchedPolicy _policy(SchedPolicy p) #define POLICY_DEBUG 0 -#define CAN_SET_SP_SYSTEM 0 // non-zero means to implement set_sched_policy(tid, SP_SYSTEM) - // This prctl is only available in Android kernels. #define PR_SET_TIMERSLACK_PID 41 @@ -60,9 +58,6 @@ static int __sys_supports_schedgroups = -1; // File descriptors open to /dev/cpuctl/../tasks, setup by initialize, or -1 on error. static int bg_cgroup_fd = -1; static int fg_cgroup_fd = -1; -#if CAN_SET_SP_SYSTEM -static int system_cgroup_fd = -1; -#endif /* Add tid to the scheduling group defined by the policy */ static int add_tid_to_cgroup(int tid, SchedPolicy policy) @@ -78,11 +73,6 @@ static int add_tid_to_cgroup(int tid, SchedPolicy policy) case SP_AUDIO_SYS: fd = fg_cgroup_fd; break; -#if CAN_SET_SP_SYSTEM - case SP_SYSTEM: - fd = system_cgroup_fd; - break; -#endif default: fd = -1; break; @@ -123,21 +113,13 @@ static void __initialize(void) { if (!access("/dev/cpuctl/tasks", F_OK)) { __sys_supports_schedgroups = 1; -#if CAN_SET_SP_SYSTEM filename = "/dev/cpuctl/tasks"; - system_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC); - if (system_cgroup_fd < 0) { - SLOGV("open of %s failed: %s\n", filename, strerror(errno)); - } -#endif - - 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/apps/bg_non_interactive/tasks"; + filename = "/dev/cpuctl/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)); @@ -231,11 +213,9 @@ int get_sched_policy(int tid, SchedPolicy *policy) if (getSchedulerGroup(tid, grpBuf, sizeof(grpBuf)) < 0) return -1; if (grpBuf[0] == '\0') { - *policy = SP_SYSTEM; - } else if (!strcmp(grpBuf, "apps/bg_non_interactive")) { - *policy = SP_BACKGROUND; - } else if (!strcmp(grpBuf, "apps")) { *policy = SP_FOREGROUND; + } else if (!strcmp(grpBuf, "bg_non_interactive")) { + *policy = SP_BACKGROUND; } else { errno = ERANGE; return -1; |