]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kselftest/arm64: Increase frequency of signal delivery in fp-stress
authorMark Brown <broonie@kernel.org>
Wed, 30 Oct 2024 00:02:02 +0000 (00:02 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 7 Nov 2024 17:06:36 +0000 (17:06 +0000)
Currently we only deliver signals to the processes being tested about once
a second, meaning that the signal code paths are subject to relatively
little stress. Increase this frequency substantially to 25ms intervals,
along with some minor refactoring to make this more readily tuneable and
maintain the 1s logging interval. This interval was chosen based on some
experimentation with emulated platforms to avoid causing so much extra load
that the test starts to run into the 45s limit for selftests or generally
completely disconnect the timeout numbers from the

We could increase this if we moved the signal generation out of the main
supervisor thread, though we should also consider that he percentage of
time that we spend interacting with the floating point state is also a
consideration.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241030-arm64-fp-stress-interval-v2-1-bd3cef48c22c@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/fp/fp-stress.c

index 13958e645afc0202c8c15e5284dac6aa6bc163d9..b81bc0842f177ba5985a2771f5ff924f04ff4582 100644 (file)
@@ -28,6 +28,9 @@
 
 #define MAX_VLS 16
 
+#define SIGNAL_INTERVAL_MS 25
+#define LOG_INTERVALS (1000 / SIGNAL_INTERVAL_MS)
+
 struct child_data {
        char *name, *output;
        pid_t pid;
@@ -448,7 +451,7 @@ static const struct option options[] = {
 int main(int argc, char **argv)
 {
        int ret;
-       int timeout = 10;
+       int timeout = 10 * (1000 / SIGNAL_INTERVAL_MS);
        int cpus, i, j, c;
        int sve_vl_count, sme_vl_count;
        bool all_children_started = false;
@@ -504,7 +507,7 @@ int main(int argc, char **argv)
                       have_sme2 ? "present" : "absent");
 
        if (timeout > 0)
-               ksft_print_msg("Will run for %ds\n", timeout);
+               ksft_print_msg("Will run for %d\n", timeout);
        else
                ksft_print_msg("Will run until terminated\n");
 
@@ -577,14 +580,14 @@ int main(int argc, char **argv)
                        break;
 
                /*
-                * Timeout is counted in seconds with no output, the
-                * tests print during startup then are silent when
-                * running so this should ensure they all ran enough
-                * to install the signal handler, this is especially
-                * useful in emulation where we will both be slow and
-                * likely to have a large set of VLs.
+                * Timeout is counted in poll intervals with no
+                * output, the tests print during startup then are
+                * silent when running so this should ensure they all
+                * ran enough to install the signal handler, this is
+                * especially useful in emulation where we will both
+                * be slow and likely to have a large set of VLs.
                 */
-               ret = epoll_wait(epoll_fd, evs, tests, 1000);
+               ret = epoll_wait(epoll_fd, evs, tests, SIGNAL_INTERVAL_MS);
                if (ret < 0) {
                        if (errno == EINTR)
                                continue;
@@ -624,8 +627,9 @@ int main(int argc, char **argv)
                        all_children_started = true;
                }
 
-               ksft_print_msg("Sending signals, timeout remaining: %d\n",
-                              timeout);
+               if ((timeout % LOG_INTERVALS) == 0)
+                       ksft_print_msg("Sending signals, timeout remaining: %d\n",
+                                      timeout);
 
                for (i = 0; i < num_children; i++)
                        child_tickle(&children[i]);