rcutorture: Add support for multiple stress-ng stressors
Add support for running multiple stress-ng stressors concurrently in rcutorture
tests. This is controlled by the --stress-ng-count option which accepts both
numbers and expressions using 'N' to represent available CPUs.
The stressors are distributed evenly among:
- CPU matrix multiplication (matrixprod)
- Directory operations (dir)
- Deep directory operations (dirdeep)
- Many directory operations (dirmany)
For example:
# Use single CPU stressor (default)
kvm.sh --stress-ng
# Use all available CPUs (N)
kvm.sh --stress-ng --stress-ng-count N
# Use half of available CPUs
kvm.sh --stress-ng --stress-ng-count N/2
# Use twice the available CPUs
kvm.sh --stress-ng --stress-ng-count N*2
# Use exact number of CPUs
kvm.sh --stress-ng --stress-ng-count 8
Users can also override the stressor distribution with --stress-ng-args
to specify their own custom stress-ng arguments. But by default,
the arguments are generated as shown in the examples above, if the
--stress-ng-args argument is skipped.
If the number CPUs available is < 4 or is not divisible by 4, then
the remaining stressors are allocated to the different types in a
round-robin fashion.
When building init, the number and type of stressors is printed for
further clarification.
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
2 files changed