diff mbox series

selftests/livepatch: define max test-syscall processes

Message ID 20240606135348.4708-1-rysulliv@redhat.com
State New
Headers show
Series selftests/livepatch: define max test-syscall processes | expand

Commit Message

Ryan Sullivan June 6, 2024, 1:53 p.m. UTC
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(-)

Comments

Joel Savitz June 6, 2024, 6:03 p.m. UTC | #1
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>
Miroslav Benes June 7, 2024, 8:50 a.m. UTC | #2
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
Petr Mladek June 14, 2024, 12:53 p.m. UTC | #3
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
diff mbox series

Patch

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