ajfabbri/af-rt-tests — pull request #1 by ajfabbri (2013-12-06 00:26:52+00:00)
Title: CPU affinity now takes arbitrary set of cpus.

(Trying github pull request. Also posting to linux-rt-users. This is my last try to submit upstream.)

Change -a (affinity) option to take a set of CPUs, instead of just one.

e.g.
cyclictest -a4,6-8 -t5

will use 5 threads, assigned round-robin to the set of CPUs {4,6,7,8}.
CPU 4 will get threads 1 and 5, CPU 6 gets thread 2, CPU 7 gets thread 3, and
CPU 8 gets thread 4.

As explained in the updated manpage, libnuma >= v2 is required for these
arbitrary CPU sets. With libnuma v1, the -a option behaves as before. As
before, compiling without libnuma is supported. The command usage help is fixed
up at compile time to always show the correct usage of the -a option.

Also note that, since numa_parse_cpustring_all() wasn't available in early
libnuma v2 versions, we use numa_parse_cpustring(). This means you'll have to
use taskset in some cases (isolcpus kernel parameter) to add the desired CPUs to
the set of allowed cores, e.g.:

taskset -c4-6 cyclictest -a4-6

Tested with out libnuma (numactl), and with versions 1.0.2 and 2.0.9-rc3.

Signed-off-by: Aaron Fabbri