From ce2164132ff336223e8a50afde94a37c7bccdffc Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 30 Nov 2021 12:35:15 -0700 Subject: [PATCH] Revert "env/dpdk: Exclude the orig cpuset in spdk_unaffinitize_thread" This reverts commit d9561c444fe3b08188c11bec4198beed4f52cf51. This patch is incorrectly iterating the CPU mask assuming it is contiguous. However, rather than fix it, let's just let the kernel scheduler place the thread where it thinks is best. It's going to prefer idle cores anyway. So reverting is the simplest way forward. Change-Id: I7b66cce7bfb6ddb108aa7576f508aa3b02b79138 Signed-off-by: Ben Walker Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10475 Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins --- lib/env_dpdk/env.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/env_dpdk/env.c b/lib/env_dpdk/env.c index 8374360ff..1d1da6918 100644 --- a/lib/env_dpdk/env.c +++ b/lib/env_dpdk/env.c @@ -353,8 +353,8 @@ void spdk_pause(void) void spdk_unaffinitize_thread(void) { - rte_cpuset_t new_cpuset, orig_cpuset; - long num_cores, i, orig_num_cores; + rte_cpuset_t new_cpuset; + long num_cores, i; CPU_ZERO(&new_cpuset); @@ -365,16 +365,6 @@ spdk_unaffinitize_thread(void) CPU_SET(i, &new_cpuset); } - rte_thread_get_affinity(&orig_cpuset); - orig_num_cores = CPU_COUNT(&orig_cpuset); - if (orig_num_cores < num_cores) { - for (i = 0; i < orig_num_cores; i++) { - if (CPU_ISSET(i, &orig_cpuset)) { - CPU_CLR(i, &new_cpuset); - } - } - } - rte_thread_set_affinity(&new_cpuset); }