Skip to contentSkip to conversation

kselftest/arm64: fp-stress output clarity improvements

PATCH In review Mark Brown 2 participants 4 messages Oct 17, 2022 – Nov 8, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover kselftest/arm64: fp-stress output clarity improvements

This series provides a couple of improvements to the output of fp-stress, making it easier to follow what's going on and our application of the timeout a bit more even.

Mark Brown (2):
kselftest/arm64: Check that all children are producing output in
fp-stress
kselftest/arm64: Provide progress messages when signalling children

 tools/testing/selftests/arm64/fp/fp-stress.c | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)

base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780

Signature · 1 line
2.30.2
author
#2 lore raw

PATCH 2/2 kselftest/arm64: Provide progress messages when signalling children

Especially when the test is configured to run for a longer time it can be reassuring to users to see that the supervising program is running OK so provide a message every second when the output timer expires.

---
 tools/testing/selftests/arm64/fp/fp-stress.c | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/arm64/fp/fp-stress.c +3 -0
index 35dc07648d52..ccbfcf847d96 100644
@@ -549,6 +549,9 @@ int main(int argc, char **argv)
 			all_children_started = true;
 		}
 
+		ksft_print_msg("Sending signals, timeout remaining: %d\n",
+			       timeout);
+
 		for (i = 0; i < num_children; i++)
 			child_tickle(&children[i]);
 
Signature · 1 line
2.30.2
author
#1 lore raw

PATCH 1/2 kselftest/arm64: Check that all children are producing output in fp-stress

In reply to Mark Brown

Currently we don't have an explicit check that when it's been a second since we have seen output produced from the test programs starting up that means all of them are running and we should start both sending signals and timing out. This is not reliable, especially on very heavily loaded systems where the test programs might take longer than a second to run.

We do skip sending signals to children that have not produced output yet so we won't cause them to exit unexpectedly by sending a signal but this can create confusion when interpreting output, for example appearing to show the tests running for less time than expected or appearing to show missed signal deliveries. Avoid issues by explicitly checking that we have seen output from all the child processes before we start sending signals or counting test run time.

This is especially likely on virtual platforms with large numbers of vector lengths supported since the platforms are slow and there will be a lot of tasks per CPU.

---
 tools/testing/selftests/arm64/fp/fp-stress.c | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
tools/testing/selftests/arm64/fp/fp-stress.c +23 -0
index 4e62a9199f97..35dc07648d52 100644
@@ -403,6 +403,8 @@ int main(int argc, char **argv)
 	int timeout = 10;
 	int cpus, tests, i, j, c;
 	int sve_vl_count, sme_vl_count, fpsimd_per_cpu;
+	bool all_children_started = false;
+	int seen_children;
 	int sve_vls[MAX_VLS], sme_vls[MAX_VLS];
 	struct epoll_event ev;
 	struct sigaction sa;
@@ -526,6 +528,27 @@ int main(int argc, char **argv)
 
 		/* Otherwise epoll_wait() timed out */
 
+		/*
+		 * If the child processes have not produced output they
+		 * aren't actually running the tests yet .
+		 */
+		if (!all_children_started) {
+			seen_children = 0;
+
+			for (i = 0; i < num_children; i++)
+				if (children[i].output_seen ||
+				    children[i].exited)
+					seen_children++;
+
+			if (seen_children != num_children) {
+				ksft_print_msg("Waiting for %d children\n",
+					       num_children - seen_children);
+				continue;
+			}
+
+			all_children_started = true;
+		}
+
 		for (i = 0; i < num_children; i++)
 			child_tickle(&children[i]);
 
Signature · 1 line
2.30.2
maintainer
#3 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown

This series provides a couple of improvements to the output of fp-stress, making it easier to follow what's going on and our application of the timeout a bit more even.

Mark Brown (2):
kselftest/arm64: Check that all children are producing output in
fp-stress
kselftest/arm64: Provide progress messages when signalling children

[...]

Applied to arm64 (for-next/selftests), thanks!

[1/2] kselftest/arm64: Check that all children are producing output in fp-stress

      https://git.kernel.org/arm64/c/3a38ef2b3cb6
[2/2] kselftest/arm64: Provide progress messages when signalling children
      https://git.kernel.org/arm64/c/3e02f57bcc6a

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev