diff options
author | braffert <braffert@google.com> | 2019-05-14 11:15:04 -0700 |
---|---|---|
committer | Zach Marano <zmarano@google.com> | 2019-05-14 11:15:04 -0700 |
commit | 8bfa7de67f90498560246c152ccdcd4a48077bb7 (patch) | |
tree | 7ad6799e289ae35aa64aec078f96eabe7afd9a7f /packages | |
parent | 64213603ea6b37714d5cbcc452f3fc954fcbd6c5 (diff) | |
download | google-compute-image-packages-8bfa7de67f90498560246c152ccdcd4a48077bb7.tar.gz |
Fix XPS settings with more than 64 vCPUs (#767)
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/google-compute-engine/src/usr/bin/google_set_multiqueue | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/google-compute-engine/src/usr/bin/google_set_multiqueue b/packages/google-compute-engine/src/usr/bin/google_set_multiqueue index 9dfe45f..7064a6b 100755 --- a/packages/google-compute-engine/src/usr/bin/google_set_multiqueue +++ b/packages/google-compute-engine/src/usr/bin/google_set_multiqueue @@ -125,10 +125,16 @@ for q in $XPS; do xps=$((xps | (1 << cpu))) done - # Linux xps_cpus requires a hex number with commas every 32 bits. - # It ignores all bits above # cpus, so unconditionally write a - # 64 bit hex value, with a comma between dwords. - xps_string=`printf "%08x,%08x" $((xps >> 32 & 0xffffffff)) $((xps & 0xffffffff))` + # Linux xps_cpus requires a hex number with commas every 32 bits. It ignores + # all bits above # cpus, so write a list of comma separated 32 bit hex values + # with a comma between dwords. + xps_dwords=() + for i in $(seq 0 $(((num_cpus - 1) / 32))) + do + xps_dwords+=(`printf "%08x" $((xps & 0xffffffff))`) + done + xps_string=$(IFS=, ; echo "${xps_dwords[*]}") + echo ${xps_string} > $q printf "Queue %d XPS=%s for %s\n" $queue_num `cat $q` $q |