#!/system/bin/sh BIG_CPUS= LITTLE_CPUS= FIRST_LITTLE_CPU= ALL_CPUS= for cpufile in /sys/devices/system/cpu/cpu*/uevent; do cpunum=${cpufile#/sys/devices/system/cpu/cpu} cpunum=${cpunum%/uevent} if grep -q -e 'ananke' $cpufile; then echo CPU $cpunum is little core LITTLE_CPUS=${LITTLE_CPUS:+$LITTLE_CPUS,}$cpunum FIRST_LITTLE_CPU=${FIRST_LITTLE_CPU:-$cpunum} elif grep -q -e 'prometheus' $cpufile; then echo CPU $cpunum is big core BIG_CPUS=${BIG_CPUS:+$BIG_CPUS,}$cpunum else echo CPU $cpunum is unknown type fi ALL_CPUS=${ALL_CPUS:+$ALL_CPUS,}$cpunum done echo BIG_CPUS=$BIG_CPUS echo LITTLE_CPUS=$LITTLE_CPUS echo FIRST_LITTLE_CPU=$FIRST_LITTLE_CPU # Foreground should contain all cores echo $ALL_CPUS >/dev/cpuset/foreground/cpus # Add foreground/boost cpuset, it is used for app launches, # and maybe other high priority tasks in the future. # It's to be set to whatever cores should be used # for short term high-priority tasks. if [ -n "${BIG_CPUS}" ]; then echo $BIG_CPUS >/dev/cpuset/foreground/boost/cpus else # set with all cpus if not found any BIG_CPUS echo $ALL_CPUS >/dev/cpuset/foreground/boost/cpus fi #background contains a small subset (generally one little core) if [ -n "${FIRST_LITTLE_CPU}" ]; then echo $FIRST_LITTLE_CPU >/dev/cpuset/background/cpus else # use cpu0 if not find any LITTLE CPUS # same as default echo 0 >/dev/cpuset/background/cpus fi # add system-background cpuset, a new cpuset for system services # that should not run on larger cores # system-background is for system tasks that should only run on