Skip to content

Commit 313916e

Browse files
authored
Extend key with physical_package_id (#100)
1 parent 3036725 commit 313916e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

provision-contest/disable-turboboost_ht

+8-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ for cpu in $(ls -1d /sys/devices/system/cpu/cpu* | sort --version-sort) ; do
2121
chmod a-w $cpu/cpufreq/scaling_governor
2222
fi
2323

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')
2632
if [[ ${core_ids[$core_id]:-} ]]; then
2733
echo 0 > $cpu/online
2834
else

0 commit comments

Comments
 (0)