linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements
@ 2022-10-17 14:45 Mark Brown
  2022-10-17 14:45 ` [PATCH v1 1/2] kselftest/arm64: Check that all children are producing output in fp-stress Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Brown @ 2022-10-17 14:45 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, 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

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


base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
-- 
2.30.2


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

* [PATCH v1 1/2] kselftest/arm64: Check that all children are producing output in fp-stress
  2022-10-17 14:45 [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Mark Brown
@ 2022-10-17 14:45 ` Mark Brown
  2022-10-17 14:45 ` [PATCH v1 2/2] kselftest/arm64: Provide progress messages when signalling children Mark Brown
  2022-11-08 17:38 ` [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-10-17 14:45 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, 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.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/fp-stress.c | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c
index 4e62a9199f97..35dc07648d52 100644
--- a/tools/testing/selftests/arm64/fp/fp-stress.c
+++ b/tools/testing/selftests/arm64/fp/fp-stress.c
@@ -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]);
 
-- 
2.30.2


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

* [PATCH v1 2/2] kselftest/arm64: Provide progress messages when signalling children
  2022-10-17 14:45 [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Mark Brown
  2022-10-17 14:45 ` [PATCH v1 1/2] kselftest/arm64: Check that all children are producing output in fp-stress Mark Brown
@ 2022-10-17 14:45 ` Mark Brown
  2022-11-08 17:38 ` [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-10-17 14:45 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Shuah Khan, Shuah Khan
  Cc: linux-arm-kernel, linux-kselftest, Mark Brown

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.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/fp-stress.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c
index 35dc07648d52..ccbfcf847d96 100644
--- a/tools/testing/selftests/arm64/fp/fp-stress.c
+++ b/tools/testing/selftests/arm64/fp/fp-stress.c
@@ -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]);
 
-- 
2.30.2


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

* Re: [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements
  2022-10-17 14:45 [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Mark Brown
  2022-10-17 14:45 ` [PATCH v1 1/2] kselftest/arm64: Check that all children are producing output in fp-stress Mark Brown
  2022-10-17 14:45 ` [PATCH v1 2/2] kselftest/arm64: Provide progress messages when signalling children Mark Brown
@ 2022-11-08 17:38 ` Will Deacon
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2022-11-08 17:38 UTC (permalink / raw)
  To: Mark Brown, Shuah Khan, Catalin Marinas, Shuah Khan
  Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kselftest

On Mon, 17 Oct 2022 15:45:51 +0100, Mark Brown wrote:
> 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,
-- 
Will

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

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

end of thread, other threads:[~2022-11-08 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 14:45 [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Mark Brown
2022-10-17 14:45 ` [PATCH v1 1/2] kselftest/arm64: Check that all children are producing output in fp-stress Mark Brown
2022-10-17 14:45 ` [PATCH v1 2/2] kselftest/arm64: Provide progress messages when signalling children Mark Brown
2022-11-08 17:38 ` [PATCH v1 0/2] kselftest/arm64: fp-stress output clarity improvements Will Deacon

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).