All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13
@ 2025-03-07 22:58 Jacob Martin
  2025-03-18 11:04 ` Cyril Hrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Martin @ 2025-03-07 22:58 UTC (permalink / raw)
  To: ltp

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13
  2025-03-07 22:58 [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13 Jacob Martin
@ 2025-03-18 11:04 ` Cyril Hrubis
  2025-04-01  7:20   ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2025-03-18 11:04 UTC (permalink / raw)
  To: Jacob Martin; +Cc: ltp

Hi!
> 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

This is just another workaround that does not fix the real issue and
that is that the C child does not communicate properly with the shell
code. The best solution here would be to rewrite these tests into C.
There is not that much work the shell does and we would avoid parsing
files written by the C helper in the shell as well.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13
  2025-03-18 11:04 ` Cyril Hrubis
@ 2025-04-01  7:20   ` Petr Vorel
  2025-04-01 18:27     ` Jacob Martin
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2025-04-01  7:20 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Hi all,

> Hi!
> > 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

> This is just another workaround that does not fix the real issue and
> that is that the C child does not communicate properly with the shell
> code. The best solution here would be to rewrite these tests into C.
> There is not that much work the shell does and we would avoid parsing
> files written by the C helper in the shell as well.

@Jacob FYI how looks the patchset which rewrites test6 to C:
https://patchwork.ozlabs.org/project/ltp/list/?series=450626&state=*

Feel free to pick another test.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13
  2025-04-01  7:20   ` Petr Vorel
@ 2025-04-01 18:27     ` Jacob Martin
  0 siblings, 0 replies; 4+ messages in thread
From: Jacob Martin @ 2025-04-01 18:27 UTC (permalink / raw)
  To: Petr Vorel, Cyril Hrubis; +Cc: ltp

On 4/1/25 2:20 AM, Petr Vorel wrote:
> Hi all,
> 
>> Hi!
>>> 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
> 
>> This is just another workaround that does not fix the real issue and
>> that is that the C child does not communicate properly with the shell
>> code. The best solution here would be to rewrite these tests into C.
>> There is not that much work the shell does and we would avoid parsing
>> files written by the C helper in the shell as well.
> 
> @Jacob FYI how looks the patchset which rewrites test6 to C:
> https://patchwork.ozlabs.org/project/ltp/list/?series=450626&state=*
> 
> Feel free to pick another test.
> 
> Kind regards,
> Petr

Thank you both for the feedback and info here. I'll work on converting 
cpuset_memory tests formerly 12 and 13 (now 11 and 12) to C.

Thanks,
Jacob

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-01 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 22:58 [LTP] [PATCH] cpuset_memory_testset.sh: Give SIGUSR1 handler time to run before changing target mapping node in tests 12 and 13 Jacob Martin
2025-03-18 11:04 ` Cyril Hrubis
2025-04-01  7:20   ` Petr Vorel
2025-04-01 18:27     ` Jacob Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.