Skip to content

Commit

Permalink
cutils: iosched_policy: Access BFQIO cgroup in /dev/bfqio
Browse files Browse the repository at this point in the history
AOSP doesn't mount cgroups in /sys/fs/cgroup, but in /dev/.
Follow what AOSP does.

Change-Id: I40d2241e3e5c41612d3a54d22981d3250f8b1ed6
  • Loading branch information
zwliew authored and B--B committed Mar 2, 2017
1 parent 71ec85d commit e56c7eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libcutils/iosched_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ int android_get_ioprio(int pid __android_unused, IoSchedClass *clazz, int *iopri
}

static void __initialize_rtio(void) {
if (!access("/sys/fs/cgroup/bfqio/tasks", W_OK) ||
!access("/sys/fs/cgroup/bfqio/rt-display/tasks", W_OK)) {
if (!access("/dev/bfqio/tasks", W_OK) ||
!access("/dev/bfqio/rt-display/tasks", W_OK)) {
__rtio_cgroup_supported = 1;
} else {
__rtio_cgroup_supported = 0;
Expand All @@ -74,9 +74,9 @@ int android_set_rt_ioprio(int tid, int rt) {
}

if (rt) {
fd = open("/sys/fs/cgroup/bfqio/rt-display/tasks", O_WRONLY | O_CLOEXEC);
fd = open("/dev/bfqio/rt-display/tasks", O_WRONLY | O_CLOEXEC);
} else {
fd = open("/sys/fs/cgroup/bfqio/tasks", O_WRONLY | O_CLOEXEC);
fd = open("/dev/bfqio/tasks", O_WRONLY | O_CLOEXEC);
}

if (fd < 0) {
Expand Down

0 comments on commit e56c7eb

Please sign in to comment.