Skip to content

Commit 62648ef

Browse files
authored
CI: don't pin NIC IRQs to housekeeping CPUs (#9568)
#6901 introduced pinning all IRQs to two housekeeping CPUs. This is an issue for S3 tests like fineweb-s3 where network is the bottleneck. Don't pin NIC IRQs to housekeeping CPUs so all cores can process them. Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
1 parent ef43456 commit 62648ef

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

scripts/setup-benchmark.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,26 @@ else
9898
BENCH_CPUS="$(IFS=,; echo "${bench[*]}")"
9999
fi
100100

101-
# Pin all IRQs to housekeeping CPUs. Some IRQs are kernel-managed and reject writes
102-
# with EPERM even as root.
101+
# Don't pin NIC queue IRQs. Pinning them serializes packet processing, and for
102+
# S3 tests like fineweb-s3 network is the bottlenenck.
103+
declare -A NET_IRQS=()
104+
bench_cpu_arr=()
105+
while IFS= read -r cpu; do bench_cpu_arr+=("$cpu"); done < <(expand_cpulist "$BENCH_CPUS")
106+
i=0
107+
for msi in /sys/class/net/*/device/msi_irqs/*; do
108+
[[ -e "$msi" && ${#bench_cpu_arr[@]} -gt 0 ]] || continue
109+
irq="${msi##*/}"
110+
NET_IRQS["$irq"]=1
111+
echo "${bench_cpu_arr[i % ${#bench_cpu_arr[@]}]}" > "/proc/irq/$irq/smp_affinity_list" 2>/dev/null || true
112+
i=$((i + 1))
113+
done
114+
115+
# Pin all non-NIC queue IRQs to housekeeping CPUs. Some IRQs are kernel-managed
116+
# and reject writes with EPERM even as root.
103117
for f in /proc/irq/[0-9]*/smp_affinity_list; do
118+
irq="${f#/proc/irq/}"
119+
irq="${irq%%/*}"
120+
[[ -n "${NET_IRQS[$irq]:-}" ]] && continue
104121
echo "$HOUSEKEEPING_CPUS" > "$f" 2>/dev/null || true
105122
done
106123

0 commit comments

Comments
 (0)