Skip to content

Commit

Permalink
scripts/perftune.py: fix the zero-IRQ-mask check on big machines
Browse files Browse the repository at this point in the history
The check introduced in "scripts: perftune.py: don't allow cpu-mask that does't include any IRQ CPU"
is broken on big machines.

This patch fixes that.

Fixes scylladb/scylladb#3339

Signed-off-by: Vlad Zolotarov <[email protected]>
  • Loading branch information
vladzcloudius committed May 15, 2018
1 parent 57f6a31 commit fcf4b6c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/perftune.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,15 @@ def irqs_cpu_mask_for_mode(mq_mode, cpu_mask):
# distribute equally between all available cores
irqs_cpu_mask = cpu_mask

if int(irqs_cpu_mask, 16) == 0:
# The irqs_cpu_mask is a coma-separated list of 32-bit hex values, e.g. 0xffff,0x0,0xffff
# We want to estimate if the whole mask is all-zeros.
# For that we will sum them all up. The sum can only be zero if all addends are zeros since all addends are
# unsigned.
irqs_masks_sum = 0
for cur_irqs_cpu_mask in irqs_cpu_mask.split(','):
irqs_masks_sum = irqs_masks_sum + int(cur_irqs_cpu_mask, 16)

if irqs_masks_sum == 0:
raise Exception("Bad configuration mode ({}) and cpu-mask value ({})".format(mq_mode.name, cpu_mask))

return irqs_cpu_mask
Expand Down

0 comments on commit fcf4b6c

Please sign in to comment.