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

Commit 568849b9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "bind android.bg in system_server to small cores"

parents 6b220343 b2f929d7
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -3004,6 +3004,16 @@ public class ActivityManagerService extends IActivityManager.Stub
        Watchdog.getInstance().addMonitor(this);
        Watchdog.getInstance().addMonitor(this);
        Watchdog.getInstance().addThread(mHandler);
        Watchdog.getInstance().addThread(mHandler);
        // bind background thread to little cores
        // this is expected to fail inside of framework tests because apps can't touch cpusets directly
        try {
            Process.setThreadGroupAndCpuset(BackgroundThread.get().getThreadId(),
                    Process.THREAD_GROUP_BG_NONINTERACTIVE);
        } catch (Exception e) {
            Slog.w(TAG, "Setting background thread cpuset failed");
        }
    }
    }
    protected ActivityStackSupervisor createStackSupervisor() {
    protected ActivityStackSupervisor createStackSupervisor() {
@@ -12650,6 +12660,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        if (!mBooted && !mBooting
        if (!mBooted && !mBooting
                && userId == UserHandle.USER_SYSTEM
                && userId == UserHandle.USER_SYSTEM
                && (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
                && (info.flags & PERSISTENT_MASK) == PERSISTENT_MASK) {
            // The system process is initialized to SCHED_GROUP_DEFAULT in init.rc.
            r.curSchedGroup = ProcessList.SCHED_GROUP_DEFAULT;
            r.setSchedGroup = ProcessList.SCHED_GROUP_DEFAULT;
            r.persistent = true;
            r.persistent = true;
            r.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
            r.maxAdj = ProcessList.PERSISTENT_PROC_ADJ;
        }
        }