File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ disable_cpu () {
1414
1515store_isolcpus_fact=" /var/tmp/isolcpus"
1616
17+ # Learn all efficency cores if they exist
18+ cpu_list=()
19+ if [ -f /sys/devices/cpu_atom/cpus ]; then
20+ range=" $( cat /sys/devices/cpu_atom/cpus) "
21+ IFS=' -' read -r start end <<< " $range"
22+ cpu_list=($( eval echo {$start ..$end }) )
23+ fi
24+
1725# shellcheck disable=SC2012
1826for cpu in $( ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
1927 [[ $( basename $cpu ) =~ ^cpu[0-9]+$ ]] || continue
@@ -49,6 +57,20 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
4957 # adds a newline after each file, we do not want to rely on `cat` to always add this
5058 # 'delimiter'.
5159 core_id=$( cat $cpu /topology/core_id | tr -d ' \n' ) ' -' $( cat $cpu /topology/physical_package_id | tr -d ' \n' )
60+
61+ # Disable all efficiency cores
62+ found=0
63+ for efficiency_core in " ${cpu_list[@]} " ; do
64+ if [[ " $cpu " == " /sys/devices/system/cpu/cpu$efficiency_core " ]]; then
65+ disable_cpu $cpu
66+ found=1
67+ break
68+ fi
69+ done
70+ if [ " $found " -eq " 1" ]; then
71+ continue
72+ fi
73+
5274 if [[ ${core_ids[$core_id]:- } ]]; then
5375 disable_cpu $cpu
5476 else
You can’t perform that action at this time.
0 commit comments