]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/livepatch: define max test-syscall processes
authorRyan Sullivan <rysulliv@redhat.com>
Thu, 6 Jun 2024 13:53:48 +0000 (09:53 -0400)
committerPetr Mladek <pmladek@suse.com>
Wed, 12 Jun 2024 14:56:30 +0000 (16:56 +0200)
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>
Tested-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Joel Savitz <jsavitz@redhat.com>
Link: https://lore.kernel.org/r/20240606135348.4708-1-rysulliv@redhat.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
tools/testing/selftests/livepatch/test-syscall.sh

index b76a881d4013afb4abf93cad7cf458da58b9747b..289eb7d4c4b34148a2353268ad65ca28ec4e2789 100755 (executable)
@@ -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