From 637f4d283c419cb7eeacbc1538f61b8216c7a51a Mon Sep 17 00:00:00 2001 From: Suneeth D Date: Mon, 17 Aug 2026 10:54:27 +0000 Subject: [PATCH] Enable numactl for will-it-scale testcases Few testcases especially memory based testcases shows too much run-2-run variance when ran for say 10 iterations. But when run with the command prefix "$numactl --membind=0" the variance goes away. This patch adds numactl parameter which can be set to true(default: false) in the job.yaml based on user's requirements. Signed-off-by: Suneeth D --- programs/will-it-scale/meta.yaml | 6 ++++++ programs/will-it-scale/pkg/depends | 1 + programs/will-it-scale/run | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/programs/will-it-scale/meta.yaml b/programs/will-it-scale/meta.yaml index 3eaa45527..a4e9bc81e 100644 --- a/programs/will-it-scale/meta.yaml +++ b/programs/will-it-scale/meta.yaml @@ -19,6 +19,10 @@ description: | warmup period before which an average is taken. The averaging period can be changed with the -s option, which by default is 5 seconds. + numactl is a boolean parameter, if true, confine the tasks and their memory to + a single node (numa_node, 0 by default) so that the results are not perturbed + by remote memory accesses. Default to false. + homepage: https://github.com/antonblanchard/will-it-scale parameters: @@ -27,6 +31,8 @@ parameters: mode: [process, thread, both] nr_task: smt: [0, 1] + numactl: + numa_node: results: will-it-scale.scalability: diff --git a/programs/will-it-scale/pkg/depends b/programs/will-it-scale/pkg/depends index 83fed7f70..283ea7a84 100644 --- a/programs/will-it-scale/pkg/depends +++ b/programs/will-it-scale/pkg/depends @@ -1,3 +1,4 @@ libhwloc5 linux-perf +numactl python-minimal diff --git a/programs/will-it-scale/run b/programs/will-it-scale/run index 86f7233e0..bd7424adf 100755 --- a/programs/will-it-scale/run +++ b/programs/will-it-scale/run @@ -5,6 +5,8 @@ # - nr_task # - no_affinity # - smt +# - numactl +# - numa_node . $LKP_SRC/lib/debug.sh . $LKP_SRC/lib/env.sh @@ -47,7 +49,16 @@ fi [[ -n "$no_affinity" ]] || no_affinity=0 +# Confine both the tasks' memory to $numa_node, so that the results are +# not perturbed by remote memory accesses. +numactl_prefix= +if [[ "$numactl" = true ]]; then + has_cmd numactl || die "numactl is not found in $PATH" + [[ -n "$numa_node" ]] || numa_node=0 + numactl_prefix="numactl --membind=$numa_node --" +fi + ulimit -n 65536 has_cmd python3 || die "python3 is not found in $PATH" -log_cmd python3 ./runtest.py $test $duration $mode $no_affinity $smt $threads_to_iterate +log_cmd $numactl_prefix python3 ./runtest.py $test $duration $mode $no_affinity $smt $threads_to_iterate