Skip to contentSkip to conversation

tools/testing/selftests/livepatch: define max test-syscall processes

PATCH In review Ryan Sullivan 5 participants 9 messages May 29, 2024 – Jun 14, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/testing/selftests/livepatch: define max test-syscall processes

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.

---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/livepatch/test-syscall.sh +4 -1
index b76a881d4013..289eb7d4c4b3 100755
@@ -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
Signature · 1 line
2.44.0
Tested-by Reviewed-by on v1 1/1
#1 lore raw

From: [email protected]

Quoted 4 lines · On Wed, 29 May 2024 16:19:41 -0400 Ryan Sullivan <[email protected]> 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 :)

Quoted 25 lines
---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/livepatch/test-syscall.sh +4 -1
index b76a881d4013..289eb7d4c4b3 100755
@@ -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
Signature · 1 line
2.44.0
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Ryan Sullivan
Quoted 7 lines · Ryan Sullivan

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.

Looks reasonable.

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.

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Ryan Sullivan

Hi,

Quoted 7 lines · Ryan Sullivan

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.

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

M

#4 lore raw

PATCH 1/1 selftests/livepatch: define max test-syscall processes

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.

---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/livepatch/test-syscall.sh +4 -1
index b76a881d4013..289eb7d4c4b3 100755
@@ -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
Signature · 1 line
2.44.0
Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] selftests/livepatch: define max test-syscall processes

Quoted 29 lines · Ryan Sullivan

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.

---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/livepatch/test-syscall.sh +4 -2
index b76a881d4013..289eb7d4c4b3 100755
@@ -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
--
Quoted 3 lines

2.44.0

#6 lore raw

Re: [PATCH] selftests/livepatch: define max test-syscall processes

In reply to Ryan Sullivan
Quoted 7 lines · Ryan Sullivan

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.

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.

Quoted 21 lines

---
 tools/testing/selftests/livepatch/test-syscall.sh | 5 ++++-

 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/livepatch/test-syscall.sh +0 -0
index b76a881d4013..289eb7d4c4b3 100755
@@ -15,7 +15,10 @@ setup_config


 start_test "patch getpid syscall while being heavily hammered"

tools/testing/selftests/livepatch/test-syscall.sh +4 -1
-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

maintainer Acked-by on v1 1/1
#7 lore raw

Re: [PATCH] selftests/livepatch: define max test-syscall processes

In reply to Ryan Sullivan
Quoted 7 lines · Ryan Sullivan

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.

M

maintainer
#8 lore raw

Re: [PATCH] selftests/livepatch: define max test-syscall processes

In reply to Ryan Sullivan
Quoted 7 lines · Ryan Sullivan

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.

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

Best Regards,
Petr