diff options
Diffstat (limited to 'tools/virtio/ringtest/run-on-all.sh')
| -rwxr-xr-x | tools/virtio/ringtest/run-on-all.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/virtio/ringtest/run-on-all.sh b/tools/virtio/ringtest/run-on-all.sh index 2e69ca812b4c..29b0d3920bfc 100755 --- a/tools/virtio/ringtest/run-on-all.sh +++ b/tools/virtio/ringtest/run-on-all.sh | |||
| @@ -1,12 +1,13 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | CPUS_ONLINE=$(lscpu --online -p=cpu|grep -v -e '#') | ||
| 3 | #use last CPU for host. Why not the first? | 4 | #use last CPU for host. Why not the first? |
| 4 | #many devices tend to use cpu0 by default so | 5 | #many devices tend to use cpu0 by default so |
| 5 | #it tends to be busier | 6 | #it tends to be busier |
| 6 | HOST_AFFINITY=$(lscpu -p=cpu | tail -1) | 7 | HOST_AFFINITY=$(echo "${CPUS_ONLINE}"|tail -n 1) |
| 7 | 8 | ||
| 8 | #run command on all cpus | 9 | #run command on all cpus |
| 9 | for cpu in $(seq 0 $HOST_AFFINITY) | 10 | for cpu in $CPUS_ONLINE |
| 10 | do | 11 | do |
| 11 | #Don't run guest and host on same CPU | 12 | #Don't run guest and host on same CPU |
| 12 | #It actually works ok if using signalling | 13 | #It actually works ok if using signalling |
