Commit 830c9c6a authored by Michal Berger's avatar Michal Berger Committed by Konrad Sztyber
Browse files

test/nvme: Return from get_pool_thread() if sqpool_cpu_thread[@] is not set



Also, call to set_potential_poll_threads() only when proper driver is
requested and instead of the cpu id just return the entire fio param
to clearly indicate what this is used for.

Change-Id: I14c63f51a80139701c181570be241c722c35bd1b
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24920


Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
parent f550b44f
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -202,8 +202,6 @@ function get_disks_on_numa() {
}

function set_potential_poll_threads() {
	[[ $PLUGIN =~ uring ]] || return 0

	local _cpus=("$@") all_fio_cpus=() cpu _cpu poll_thread
	local -g sqpoll_cpu_threads
	local node
@@ -222,7 +220,7 @@ function set_potential_poll_threads() {
	# sense to still use sqthread_poll?
	#
	# Here we build list of all potential candidates to hold sqpoll thread. Lists are per node and should hold
	# all cpus outside of the fio cpus that were requested. So each get_poll_thread() should return a cpu
	# all cpus outside of the fio cpus that were requested. So each get_sqthread_poll_cpu() should return a cpu
	# thread which is guaranteed to be outside of the physical core of each of fio cpus (but still bound to
	# the same numa node as the fio cpu selected for given job).
	for cpu in "${cpus[@]}"; do
@@ -234,12 +232,14 @@ function set_potential_poll_threads() {
	done
}

function get_poll_thread() {
function get_sqthread_poll_cpu() {
	((${#sqpoll_cpu_threads[@]} > 0)) || return 0

	local node=$1 idx=$2
	local -n node=${sqpoll_cpu_threads[node]}

	# Default to the highest cpu
	echo "${node[idx]:-${cpus[-1]}}"
	echo "sqthread_poll_cpu=${node[idx]:-${cpus[-1]}}"
}

function create_fio_config() {
@@ -296,7 +296,9 @@ function create_fio_config() {
	fi

	# shellcheck disable=SC2068
	if [[ $PLUGIN =~ "uring" || $PLUGIN =~ "xnvme" ]]; then
		set_potential_poll_threads ${cores[@]//,/ }
	fi

	for i in "${!cores[@]}"; do
		local m=0 #Counter of disks per NUMA node
@@ -323,7 +325,7 @@ function create_fio_config() {
			fio_job_section+=("[filename${i}]")
			fio_job_section+=("iodepth=$QD")
			fio_job_section+=("cpus_allowed=${cores[$i]} #CPU NUMA Node ${cores_numa[$i]} ($FIO_FNAME_STRATEGY)")
			fio_job_section+=("sqthread_poll_cpu=$(get_poll_thread "${cores_numa[i]}" "$i")")
			fio_job_section+=("$(get_sqthread_poll_cpu "${cores_numa[i]}" "$i")")
		fi

		while [[ "$m" -lt "$total_disks_per_core" ]]; do
@@ -335,7 +337,7 @@ function create_fio_config() {
					fio_job_section+=("[filename${m}-${cores[$i]}]")
					fio_job_section+=("iodepth=$QD")
					fio_job_section+=("cpus_allowed=${cores[$i]} #CPU NUMA Node ${cores_numa[$i]}")
					fio_job_section+=("sqthread_poll_cpu=$(get_poll_thread "${cores_numa[i]}" "$i")")
					fio_job_section+=("$(get_sqthread_poll_cpu "${cores_numa[i]}" "$i")")
				fi

				if [[ "$plugin" == "spdk-plugin-nvme" ]]; then