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

Commit 948c6ecc authored by Tim Murray's avatar Tim Murray Committed by Android (Google) Code Review
Browse files

Merge "add cpuset support" into mnc-dev

parents 1cc86956 9e41c747
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ else
    LOCAL_CFLAGS += -DPACKED=""
endif

ifneq ($(ENABLE_CPUSETS),)
    LOCAL_CFLAGS += -DENABLE_CPUSETS
endif

LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES

LOCAL_CFLAGS += -DU_USING_ICU_NAMESPACE=0
+21 −2
Original line number Diff line number Diff line
@@ -239,7 +239,8 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
        if (t_pri <= ANDROID_PRIORITY_AUDIO) {
            int scheduler = sched_getscheduler(t_pid);
            if ((scheduler == SCHED_FIFO) || (scheduler == SCHED_RR)) {
                // This task wants to stay in it's current audio group so it can keep it's budget
                // This task wants to stay in its current audio group so it can keep its budget
                // don't update its cpuset or cgroup
                continue;
            }
        }
@@ -247,15 +248,33 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
        if (isDefault) {
            if (t_pri >= ANDROID_PRIORITY_BACKGROUND) {
                // This task wants to stay at background
                // update its cpuset so it doesn't only run on bg core(s)
#ifdef ENABLE_CPUSETS
                int err = set_cpuset_policy(t_pid, sp);
                if (err != NO_ERROR) {
                    signalExceptionForGroupError(env, -err);
                    break;
                }
#endif
                continue;
            }
        }
        int err;
#ifdef ENABLE_CPUSETS
        // set both cpuset and cgroup for general threads
        err = set_cpuset_policy(t_pid, sp);
        if (err != NO_ERROR) {
            signalExceptionForGroupError(env, -err);
            break;
        }
#endif

        int err = set_sched_policy(t_pid, sp);
        err = set_sched_policy(t_pid, sp);
        if (err != NO_ERROR) {
            signalExceptionForGroupError(env, -err);
            break;
        }

    }
    closedir(d);
}