File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,14 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
21
21
chmod a-w $cpu /cpufreq/scaling_governor
22
22
fi
23
23
24
- # Disable all but one thread on each core.
25
- core_id=$( cat $cpu /topology/core_id)
24
+ # Disable all but one thread on each core. Both core_id and physical_package_id are
25
+ # numbers it must be ensured that for the following examples are seen as distinct:
26
+ # - core_id=1, physical_package=11
27
+ # - core_id=11, physycal_package=1
28
+ # Simple concatenation would result in the string '111' for both cores. Though `cat`
29
+ # adds a newline after each file, we do not want to rely on `cat` to always add this
30
+ # 'delimiter'.
31
+ core_id=$( cat $cpu /topology/core_id | tr -d ' \n' ) ' -' $( cat $cpu /topology/physical_package_id | tr -d ' \n' )
26
32
if [[ ${core_ids[$core_id]:- } ]]; then
27
33
echo 0 > $cpu /online
28
34
else
You can’t perform that action at this time.
0 commit comments