perftune.py: introduce a generic auto_detect_irq_mask(cpu_mask) function
perftune.py: introduce a generic auto_detect_irq_mask(cpu_mask) function

Auto-detection of a 'mode' is completely generic now and depends only
on a CPU configuration and on a user provided 'cpu_mask' parameter.
The later is used to restrict tweaking to a specific subset of CPUs out
of present on a machine.

A new function calculates the mask of CPUs to use for IRQs binding.
The logic mimics the currently existing auto-detection logic and extends
it for big machines (larger than 16 CPU cores):

* up to 4 CPU threads: use 'cpu_mask'
* up to 4 CPU cores (on x86 this would translate to 8 CPU threads): use a
  single CPU thread out of allowed
* up to 16 CPU cores: use a single CPU core out of allowed
* (new) more than 16 CPU cores: use a single CPU core for each 16 CPU
  threads and distribute them evenly among all present NUMA nodes.

In addition, the new function is going to raise an AutodetectError exception
if 'cpu_mask' is defined in a way that there is a different number of threads
and/or cores among different NUMA nodes. In such a case a user needs to provide
an IRQ CPUs definition explicitly using 'irq_cpu_mask' parameter.

syuu1228/seastar,scylladb/seastar,syuu1228/seastar,scylladb/seastar,syuu1228/seastar,scylladb/seastar