File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set -eu -o pipefail
4
4
shopt -s extglob
5
5
6
6
declare -A core_ids
7
+ declare -A disabled_cores
7
8
8
9
# Learn all efficency cores if they exist
9
10
cpu_list=()
@@ -13,6 +14,14 @@ if [ -f /sys/devices/cpu_atom/cpus ]; then
13
14
cpu_list=($( eval echo {$start ..$end }) )
14
15
fi
15
16
17
+ disable_cpu () {
18
+ cpu=" $1 "
19
+ echo 0 > $cpu /online
20
+ disabled_cores+=(" ${cpu##*/ } " )
21
+ }
22
+
23
+ store_isolcpus_fact=" /var/tmp/isolcpus"
24
+
16
25
# shellcheck disable=SC2012
17
26
for cpu in $( ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
18
27
[[ $( basename $cpu ) =~ ^cpu[0-9]+$ ]] || continue
@@ -53,7 +62,7 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
53
62
found=0
54
63
for efficiency_core in " ${cpu_list[@]} " ; do
55
64
if [[ " $cpu " == " /sys/devices/system/cpu/cpu$efficiency_core " ]]; then
56
- echo 0 > $cpu /online
65
+ disable_cpu $cpu
57
66
found=1
58
67
break
59
68
fi
@@ -63,7 +72,7 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
63
72
fi
64
73
65
74
if [[ ${core_ids[$core_id]:- } ]]; then
66
- echo 0 > $cpu /online
75
+ disable_cpu $cpu
67
76
else
68
77
core_ids[$core_id ]=1
69
78
fi
@@ -94,3 +103,8 @@ elif [ -d $DIR_AMD ]; then
94
103
else
95
104
echo " Warning: kernel (turbo) boost config not found in '$DIR_INTEL ' or '$DIR_AMD '."
96
105
fi
106
+
107
+ if [ -n " ${store_isolcpus_fact} " ]; then
108
+ csv_string=$( IFS=, ; echo " ${disabled_cores[*]} " )
109
+ echo " $csv_string " > " $store_isolcpus_fact "
110
+ fi
You can’t perform that action at this time.
0 commit comments