test/scheduler: Use CPU list rather than cpumask

When we select CPUs for the scheduler tests we pick up all siblings
from given core. On some nodes in the CI these threads may have IDs
in ranges that simply overflow during the shift operation ( > 62).

To avoid this, use a list instead of a mask. Also, deny all threads
with IDs > 127 as DPDK doesn't support them anyway.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ib83649a762cb31a460184d1e0b594c112aea2bab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16604
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Michal Berger 2023-01-30 17:10:38 +01:00 committed by Tomasz Zawadzki
parent 6f3127adb1
commit 5ad2877dc4
2 changed files with 4 additions and 11 deletions

View File

@ -143,13 +143,7 @@ offline_cpu() {
}
mask_cpus() {
local cpu
local mask=0
for cpu; do
((mask |= 1 << cpu))
done
printf '0x%x\n' "$mask"
printf '[%s]\n' "$(fold_array_onto_string "$@")"
}
denied_list() {
@ -162,7 +156,7 @@ filter_allowed_list() {
local cpu
for cpu in "${!allowed[@]}"; do
if [[ -n ${denied[cpu]} ]]; then
if [[ -n ${denied[cpu]} ]] || ((cpu > 127)); then
unset -v "allowed[cpu]"
fi
done

View File

@ -34,7 +34,7 @@ thread_stats() {
idle() {
local reactor_framework
local reactors thread
local cpumask thread_cpumask
local thread_cpumask
local threads
exec_under_dynamic_scheduler "${SPDK_APP[@]}" -m "$spdk_cpumask" --main-core "$spdk_main_core"
@ -53,10 +53,9 @@ idle() {
for thread in "${threads[@]}"; do
thread_cpumask=0x$(jq -r "select(.lcore == $spdk_main_core) | .lw_threads[] | select(.name == \"$thread\") | .cpumask" <<< "$reactor_framework")
((cpumask |= thread_cpumask))
printf 'SPDK cpumask: %s Thread %s cpumask: %s\n' "$spdk_cpumask" "$thread" "$thread_cpumask"
done
printf 'SPDK cpumask: %x Threads cpumask: %x\n' "$spdk_cpumask" "$cpumask"
thread_stats
done