live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes
@ 2024-05-29 20:19 Ryan Sullivan
  2024-05-29 21:09 ` Marcos Paulo de Souza
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ryan Sullivan @ 2024-05-29 20:19 UTC (permalink / raw)
  To: live-patching, linux-kselftest, linux-kernel
  Cc: mpdesouza, jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah

Define a maximum allowable number of pids that can be livepatched in
test-syscall.sh as with extremely large machines the output from a
large number of processes overflows the dev/kmsg "expect" buffer in
the "check_result" function and causes a false error.

Reported-by: CKI Project <cki-project@redhat.com>
Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
index b76a881d4013..289eb7d4c4b3 100755
--- a/tools/testing/selftests/livepatch/test-syscall.sh
+++ b/tools/testing/selftests/livepatch/test-syscall.sh
@@ -15,7 +15,10 @@ setup_config
 
 start_test "patch getpid syscall while being heavily hammered"
 
-for i in $(seq 1 $(getconf _NPROCESSORS_ONLN)); do
+NPROC=$(getconf _NPROCESSORS_ONLN)
+MAXPROC=128
+
+for i in $(seq 1 $(($NPROC < $MAXPROC ? $NPROC : $MAXPROC))); do
 	./test_klp-call_getpid &
 	pids[$i]="$!"
 done
-- 
2.44.0


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

* Re: [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes
  2024-05-29 20:19 [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes Ryan Sullivan
@ 2024-05-29 21:09 ` Marcos Paulo de Souza
  2024-05-31  8:42 ` Petr Mladek
  2024-05-31 11:05 ` Miroslav Benes
  2 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2024-05-29 21:09 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: mpdesouza, live-patching, linux-kselftest, linux-kernel, jpoimboe,
	jikos, mbenes, pmladek, joe.lawrence, shuah

From: mpdesouza@suse.com

On Wed, 29 May 2024 16:19:41 -0400 Ryan Sullivan <rysulliv@redhat.com> wrote:

> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.

I believe that 128 threads hammering getpid is good enough :)

Tested-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com>

> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
> ---
>  tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
> index b76a881d4013..289eb7d4c4b3 100755
> --- a/tools/testing/selftests/livepatch/test-syscall.sh
> +++ b/tools/testing/selftests/livepatch/test-syscall.sh
> @@ -15,7 +15,10 @@ setup_config
>  
>  start_test "patch getpid syscall while being heavily hammered"
>  
> -for i in $(seq 1 $(getconf _NPROCESSORS_ONLN)); do
> +NPROC=$(getconf _NPROCESSORS_ONLN)
> +MAXPROC=128
> +
> +for i in $(seq 1 $(($NPROC < $MAXPROC ? $NPROC : $MAXPROC))); do
>  	./test_klp-call_getpid &
>  	pids[$i]="$!"
>  done
> -- 
> 2.44.0

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

* Re: [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes
  2024-05-29 20:19 [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes Ryan Sullivan
  2024-05-29 21:09 ` Marcos Paulo de Souza
@ 2024-05-31  8:42 ` Petr Mladek
  2024-05-31 11:05 ` Miroslav Benes
  2 siblings, 0 replies; 9+ messages in thread
From: Petr Mladek @ 2024-05-31  8:42 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: live-patching, linux-kselftest, linux-kernel, mpdesouza, jpoimboe,
	jikos, mbenes, joe.lawrence, shuah

On Wed 2024-05-29 16:19:41, Ryan Sullivan wrote:
> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>

Looks reasonable.

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

PS: I am going to queue it for 6.11. I will add it into
    a pull request for 6.10-rcX if there will be another more
    critical fix which would need such a pull request.

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

* Re: [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes
  2024-05-29 20:19 [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes Ryan Sullivan
  2024-05-29 21:09 ` Marcos Paulo de Souza
  2024-05-31  8:42 ` Petr Mladek
@ 2024-05-31 11:05 ` Miroslav Benes
  2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
  2 siblings, 1 reply; 9+ messages in thread
From: Miroslav Benes @ 2024-05-31 11:05 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: live-patching, linux-kselftest, linux-kernel, mpdesouza, jpoimboe,
	jikos, pmladek, joe.lawrence, shuah

Hi,

On Wed, 29 May 2024, Ryan Sullivan wrote:

> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>

a nit: we usually use just "selftests/livepatch:" prefix in Subject.

Acked-by: Miroslav Benes <mbenes@suse.cz>

M

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

* [PATCH] selftests/livepatch: define max test-syscall processes
  2024-05-31 11:05 ` Miroslav Benes
@ 2024-06-06 13:53   ` Ryan Sullivan
  2024-06-06 18:03     ` Joel Savitz
                       ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ryan Sullivan @ 2024-06-06 13:53 UTC (permalink / raw)
  To: live-patching, linux-kselftest, linux-kernel
  Cc: mpdesouza, jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah

Define a maximum allowable number of pids that can be livepatched in
test-syscall.sh as with extremely large machines the output from a
large number of processes overflows the dev/kmsg "expect" buffer in
the "check_result" function and causes a false error.

Reported-by: CKI Project <cki-project@redhat.com>
Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
index b76a881d4013..289eb7d4c4b3 100755
--- a/tools/testing/selftests/livepatch/test-syscall.sh
+++ b/tools/testing/selftests/livepatch/test-syscall.sh
@@ -15,7 +15,10 @@ setup_config
 
 start_test "patch getpid syscall while being heavily hammered"
 
-for i in $(seq 1 $(getconf _NPROCESSORS_ONLN)); do
+NPROC=$(getconf _NPROCESSORS_ONLN)
+MAXPROC=128
+
+for i in $(seq 1 $(($NPROC < $MAXPROC ? $NPROC : $MAXPROC))); do
 	./test_klp-call_getpid &
 	pids[$i]="$!"
 done
-- 
2.44.0


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

* Re: [PATCH] selftests/livepatch: define max test-syscall processes
  2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
@ 2024-06-06 18:03     ` Joel Savitz
  2024-06-06 18:27     ` Marcos Paulo de Souza
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Joel Savitz @ 2024-06-06 18:03 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: live-patching, linux-kselftest, linux-kernel, mpdesouza, jpoimboe,
	jikos, mbenes, pmladek, joe.lawrence, shuah

On Thu, Jun 6, 2024 at 9:54 AM Ryan Sullivan <rysulliv@redhat.com> wrote:
>
> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
>
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>
> ---
>  tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/livepatch/test-syscall.sh b/tools/testing/selftests/livepatch/test-syscall.sh
> index b76a881d4013..289eb7d4c4b3 100755
> --- a/tools/testing/selftests/livepatch/test-syscall.sh
> +++ b/tools/testing/selftests/livepatch/test-syscall.sh
> @@ -15,7 +15,10 @@ setup_config
>
>  start_test "patch getpid syscall while being heavily hammered"
>
> -for i in $(seq 1 $(getconf _NPROCESSORS_ONLN)); do
> +NPROC=$(getconf _NPROCESSORS_ONLN)
> +MAXPROC=128
> +
> +for i in $(seq 1 $(($NPROC < $MAXPROC ? $NPROC : $MAXPROC))); do
>         ./test_klp-call_getpid &
>         pids[$i]="$!"
>  done
> --
> 2.44.0
>
>
Acked-by: Joel Savitz <jsavitz@redhat.com>


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

* Re: [PATCH] selftests/livepatch: define max test-syscall processes
  2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
  2024-06-06 18:03     ` Joel Savitz
@ 2024-06-06 18:27     ` Marcos Paulo de Souza
  2024-06-07  8:50     ` Miroslav Benes
  2024-06-14 12:53     ` Petr Mladek
  3 siblings, 0 replies; 9+ messages in thread
From: Marcos Paulo de Souza @ 2024-06-06 18:27 UTC (permalink / raw)
  To: Ryan Sullivan, live-patching, linux-kselftest, linux-kernel
  Cc: jpoimboe, jikos, mbenes, pmladek, joe.lawrence, shuah

On Thu, 2024-06-06 at 09:53 -0400, Ryan Sullivan wrote:
> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>

Hi Ryan,

is this the same patch that you sent on ? I couldn't spot any changes,
and you also didn't tagged a different version for this patch.

> ---
>  tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/livepatch/test-syscall.sh
> b/tools/testing/selftests/livepatch/test-syscall.sh
> index b76a881d4013..289eb7d4c4b3 100755
> --- a/tools/testing/selftests/livepatch/test-syscall.sh
> +++ b/tools/testing/selftests/livepatch/test-syscall.sh
> @@ -15,7 +15,10 @@ setup_config
>  
>  start_test "patch getpid syscall while being heavily hammered"
>  
> -for i in $(seq 1 $(getconf _NPROCESSORS_ONLN)); do
> +NPROC=$(getconf _NPROCESSORS_ONLN)
> +MAXPROC=128
> +
> +for i in $(seq 1 $(($NPROC < $MAXPROC ? $NPROC : $MAXPROC))); do
>  	./test_klp-call_getpid &
>  	pids[$i]="$!"
>  done


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

* Re: [PATCH] selftests/livepatch: define max test-syscall processes
  2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
  2024-06-06 18:03     ` Joel Savitz
  2024-06-06 18:27     ` Marcos Paulo de Souza
@ 2024-06-07  8:50     ` Miroslav Benes
  2024-06-14 12:53     ` Petr Mladek
  3 siblings, 0 replies; 9+ messages in thread
From: Miroslav Benes @ 2024-06-07  8:50 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: live-patching, linux-kselftest, linux-kernel, mpdesouza, jpoimboe,
	jikos, pmladek, joe.lawrence, shuah

On Thu, 6 Jun 2024, Ryan Sullivan wrote:

> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>

Acked-by: Miroslav Benes <mbenes@suse.cz>

M


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

* Re: [PATCH] selftests/livepatch: define max test-syscall processes
  2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
                       ` (2 preceding siblings ...)
  2024-06-07  8:50     ` Miroslav Benes
@ 2024-06-14 12:53     ` Petr Mladek
  3 siblings, 0 replies; 9+ messages in thread
From: Petr Mladek @ 2024-06-14 12:53 UTC (permalink / raw)
  To: Ryan Sullivan
  Cc: live-patching, linux-kselftest, linux-kernel, mpdesouza, jpoimboe,
	jikos, mbenes, joe.lawrence, shuah

On Thu 2024-06-06 09:53:48, Ryan Sullivan wrote:
> Define a maximum allowable number of pids that can be livepatched in
> test-syscall.sh as with extremely large machines the output from a
> large number of processes overflows the dev/kmsg "expect" buffer in
> the "check_result" function and causes a false error.
> 
> Reported-by: CKI Project <cki-project@redhat.com>
> Signed-off-by: Ryan Sullivan <rysulliv@redhat.com>

JFYI, the patch has been committed into livepatching.git,
branch for-6.11.

Best Regards,
Petr

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

end of thread, other threads:[~2024-06-14 12:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 20:19 [PATCH] tools/testing/selftests/livepatch: define max test-syscall processes Ryan Sullivan
2024-05-29 21:09 ` Marcos Paulo de Souza
2024-05-31  8:42 ` Petr Mladek
2024-05-31 11:05 ` Miroslav Benes
2024-06-06 13:53   ` [PATCH] selftests/livepatch: " Ryan Sullivan
2024-06-06 18:03     ` Joel Savitz
2024-06-06 18:27     ` Marcos Paulo de Souza
2024-06-07  8:50     ` Miroslav Benes
2024-06-14 12:53     ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).