Skip to content

Commit a3590d7

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Increase frequency of signal delivery in fp-stress
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 69c0d82 commit a3590d7

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

tools/testing/selftests/arm64/fp/fp-stress.c

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
#define MAX_VLS 16
3030

31+
#define SIGNAL_INTERVAL_MS 25
32+
#define LOG_INTERVALS (1000 / SIGNAL_INTERVAL_MS)
33+
3134
struct child_data {
3235
char *name, *output;
3336
pid_t pid;
@@ -448,7 +451,7 @@ static const struct option options[] = {
448451
int main(int argc, char **argv)
449452
{
450453
int ret;
451-
int timeout = 10;
454+
int timeout = 10 * (1000 / SIGNAL_INTERVAL_MS);
452455
int cpus, i, j, c;
453456
int sve_vl_count, sme_vl_count;
454457
bool all_children_started = false;
@@ -504,7 +507,7 @@ int main(int argc, char **argv)
504507
have_sme2 ? "present" : "absent");
505508

506509
if (timeout > 0)
507-
ksft_print_msg("Will run for %ds\n", timeout);
510+
ksft_print_msg("Will run for %d\n", timeout);
508511
else
509512
ksft_print_msg("Will run until terminated\n");
510513

@@ -577,14 +580,14 @@ int main(int argc, char **argv)
577580
break;
578581

579582
/*
580-
* Timeout is counted in seconds with no output, the
581-
* tests print during startup then are silent when
582-
* running so this should ensure they all ran enough
583-
* to install the signal handler, this is especially
584-
* useful in emulation where we will both be slow and
585-
* likely to have a large set of VLs.
583+
* Timeout is counted in poll intervals with no
584+
* output, the tests print during startup then are
585+
* silent when running so this should ensure they all
586+
* ran enough to install the signal handler, this is
587+
* especially useful in emulation where we will both
588+
* be slow and likely to have a large set of VLs.
586589
*/
587-
ret = epoll_wait(epoll_fd, evs, tests, 1000);
590+
ret = epoll_wait(epoll_fd, evs, tests, SIGNAL_INTERVAL_MS);
588591
if (ret < 0) {
589592
if (errno == EINTR)
590593
continue;
@@ -624,8 +627,9 @@ int main(int argc, char **argv)
624627
all_children_started = true;
625628
}
626629

627-
ksft_print_msg("Sending signals, timeout remaining: %d\n",
628-
timeout);
630+
if ((timeout % LOG_INTERVALS) == 0)
631+
ksft_print_msg("Sending signals, timeout remaining: %d\n",
632+
timeout);
629633

630634
for (i = 0; i < num_children; i++)
631635
child_tickle(&children[i]);

0 commit comments

Comments
 (0)