From e52df268d3b8c6509f2e03c6f37130271a8932be Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 22 Apr 2021 18:27:29 +0200 Subject: [PATCH] test/scheduler: Check if load on all working CPUs is under 80% Signed-off-by: Michal Berger Signed-off-by: Tomasz Zawadzki Change-Id: I89e31aceb7037c55801f4b7cbd4126bce38ae174 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7566 Tested-by: SPDK CI Jenkins Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Community-CI: Broadcom CI --- test/scheduler/load_balancing.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/scheduler/load_balancing.sh b/test/scheduler/load_balancing.sh index 9f6848acf..d9194e269 100755 --- a/test/scheduler/load_balancing.sh +++ b/test/scheduler/load_balancing.sh @@ -205,6 +205,15 @@ core_load() { sleep $((3 * sched_period)) update_thread_cpus_map + # Verify that load is not exceeding 80% on each of the cpus except the main and next cpu + get_cpu_time 5 user "${cpus[@]:2}" + + for cpu in "${!avg_cpu_time[@]}"; do + printf '* cpu%u avg load: %u%% (%s)\n' \ + "$cpu" "${avg_cpu_time[cpu]}" "${cpu_times[cpu]}" + ((avg_cpu_time[cpu] <= 80)) + done + for thread in \ "$thread0" \ "$thread1" \