[LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13
Jacob Martin
jacob.martin@canonical.com
Fri Mar 7 23:58:04 CET 2025
The cpuset_memory test occasionally fails on test12 and test13. Both
intend to map anonymous memory on NUMA node 1, then swap to node 0 and
map more anonymous memory, verifying that memory was mapped to the
correct nodes along the way. On some high performance and high core
count x86 instances we observed 0 would be written to cpuset.mems before
the mapping program receives and handles SIGUSR1, causing the mapping
program to map on node 0 instead of the expected node 1, and thus
resulting in a test failure.
cpuset_memory 1 TINFO: CPUs are numbered continuously starting at 0 (0-223)
cpuset_memory 1 TINFO: Nodes are numbered continuously starting at 0 (0-1)
cpuset_memory 1 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 3 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 5 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 7 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 9 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 11 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 13 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 15 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 17 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 19 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 21 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 23 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 25 TFAIL: allocate memory on the Node#0(Expect: Node#1).
cpuset_memory 27 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 29 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 31 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 33 TPASS: Cpuset memory allocation test succeeded.
cpuset_memory 35 TPASS: Cpuset memory allocation test succeeded.
INFO: ltp-pan reported some tests FAIL
This is resolved by adding a 1 second delay between sending the first
SIGUSR1 signal and setting cpuset.mems to 0, which gives the SIGUSR1
handler time to complete and map to node 1, before switching to node 0.
Fixes: 70259d6e7
Signed-off-by: Jacob Martin <jacob.martin@canonical.com>
---
.../cpuset/cpuset_memory_test/cpuset_memory_testset.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
index c1e7cea8f..04d7cc877 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
@@ -383,7 +383,7 @@ talk2memory_test_for_case_12_13()
sleep 1
echo $1 > "$2/tasks"
/bin/kill -s SIGUSR1 $1
-
+ sleep 1
echo 0 > "$2/cpuset.mems" || return 1
sleep 1
/bin/kill -s SIGUSR1 $1
--
2.43.0
More information about the ltp
mailing list