Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3ab58bf authored by Erik Staats's avatar Erik Staats Committed by android-build-merger
Browse files

Merge "Change get_sched_policy to check "schedtune" and "cpuset"." am:...

Merge "Change get_sched_policy to check "schedtune" and "cpuset"." am: e74ecbfd am: b8179744 am: c023a8bc
am: 548c87d5

Change-Id: I1e0ec2e615570fceb504f898df149fafbb77b029
parents c53f8e54 548c87d5
Loading
Loading
Loading
Loading
+18 −18
Original line number Original line Diff line number Diff line
@@ -263,8 +263,13 @@ int get_sched_policy(int tid, SchedPolicy *policy)


    char grpBuf[32];
    char grpBuf[32];


    if (cpusets_enabled()) {
    grpBuf[0] = '\0';
    if (schedboost_enabled()) {
        if (getCGroupSubsys(tid, "schedtune", grpBuf, sizeof(grpBuf)) < 0) return -1;
    }
    if ((grpBuf[0] == '\0') && cpusets_enabled()) {
        if (getCGroupSubsys(tid, "cpuset", grpBuf, sizeof(grpBuf)) < 0) return -1;
        if (getCGroupSubsys(tid, "cpuset", grpBuf, sizeof(grpBuf)) < 0) return -1;
    }
    if (grpBuf[0] == '\0') {
    if (grpBuf[0] == '\0') {
        *policy = SP_FOREGROUND;
        *policy = SP_FOREGROUND;
    } else if (!strcmp(grpBuf, "foreground")) {
    } else if (!strcmp(grpBuf, "foreground")) {
@@ -279,11 +284,6 @@ int get_sched_policy(int tid, SchedPolicy *policy)
        errno = ERANGE;
        errno = ERANGE;
        return -1;
        return -1;
    }
    }
    } else {
        // In b/34193533, we removed bg_non_interactive cgroup, so now
        // all threads are in FOREGROUND cgroup
        *policy = SP_FOREGROUND;
    }
    return 0;
    return 0;
}
}