diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-03-09 17:40:37 +0700 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-03-09 17:40:37 +0700 |
commit | 0bae2f17323a4630c487a9b77c37bebf407424af (patch) | |
tree | fc1f71a0209ec61841a5acb65d59d147af3cc4fa /tools/virtio/ringtest/run-on-all.sh | |
parent | adf32eaa05323449b74b36f25b918583e2bdb6f1 (diff) | |
parent | ca801a22f465eae39fadc770e15b5b7e82595f81 (diff) | |
download | talos-obmc-linux-0bae2f17323a4630c487a9b77c37bebf407424af.tar.gz talos-obmc-linux-0bae2f17323a4630c487a9b77c37bebf407424af.zip |
Merge branch 'ib-mfd-regulator-gpio-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel
Diffstat (limited to 'tools/virtio/ringtest/run-on-all.sh')
-rwxr-xr-x | tools/virtio/ringtest/run-on-all.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/virtio/ringtest/run-on-all.sh b/tools/virtio/ringtest/run-on-all.sh new file mode 100755 index 000000000000..52b0f71ffa8d --- /dev/null +++ b/tools/virtio/ringtest/run-on-all.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +#use last CPU for host. Why not the first? +#many devices tend to use cpu0 by default so +#it tends to be busier +HOST_AFFINITY=$(cd /dev/cpu; ls|grep -v '[a-z]'|sort -n|tail -1) + +#run command on all cpus +for cpu in $(cd /dev/cpu; ls|grep -v '[a-z]'|sort -n); +do + #Don't run guest and host on same CPU + #It actually works ok if using signalling + if + (echo "$@" | grep -e "--sleep" > /dev/null) || \ + test $HOST_AFFINITY '!=' $cpu + then + echo "GUEST AFFINITY $cpu" + "$@" --host-affinity $HOST_AFFINITY --guest-affinity $cpu + fi +done +echo "NO GUEST AFFINITY" +"$@" --host-affinity $HOST_AFFINITY +echo "NO AFFINITY" +"$@" |