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 () {
14
14
15
15
store_isolcpus_fact=" /var/tmp/isolcpus"
16
16
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
+
17
25
# shellcheck disable=SC2012
18
26
for cpu in $( ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
19
27
[[ $( basename $cpu ) =~ ^cpu[0-9]+$ ]] || continue
@@ -49,6 +57,20 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
49
57
# adds a newline after each file, we do not want to rely on `cat` to always add this
50
58
# 'delimiter'.
51
59
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
+
52
74
if [[ ${core_ids[$core_id]:- } ]]; then
53
75
disable_cpu $cpu
54
76
else
You can’t perform that action at this time.
0 commit comments