Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / tools / virtio / ringtest / run-on-all.sh
blob52b0f71ffa8da0e3e25d46e5337d8e2aba0737b4
1 #!/bin/sh
3 #use last CPU for host. Why not the first?
4 #many devices tend to use cpu0 by default so
5 #it tends to be busier
6 HOST_AFFINITY=$(cd /dev/cpu; ls|grep -v '[a-z]'|sort -n|tail -1)
8 #run command on all cpus
9 for cpu in $(cd /dev/cpu; ls|grep -v '[a-z]'|sort -n);
11 #Don't run guest and host on same CPU
12 #It actually works ok if using signalling
14 (echo "$@" | grep -e "--sleep" > /dev/null) || \
15 test $HOST_AFFINITY '!=' $cpu
16 then
17 echo "GUEST AFFINITY $cpu"
18 "$@" --host-affinity $HOST_AFFINITY --guest-affinity $cpu
20 done
21 echo "NO GUEST AFFINITY"
22 "$@" --host-affinity $HOST_AFFINITY
23 echo "NO AFFINITY"
24 "$@"