[LTP] LTP Release preparations

Cyril Hrubis chrubis@suse.cz
Wed Sep 3 15:20:15 CEST 2025


Hi!
> > After an analysis we are now sure that it's not a product bug but a test 
> > issue. There might be a need to fallback the patch if we can't fix the 
> > test before release. @Li WDYT?
> 
> Try this:
> 
> diff --git a/testcases/realtime/func/sched_football/sched_football.c b/testcases/realtime/func/sched_football/sched_football.c
> index 0617bdb87..0d64210b0 100644
> --- a/testcases/realtime/func/sched_football/sched_football.c
> +++ b/testcases/realtime/func/sched_football/sched_football.c
> @@ -115,8 +115,8 @@ void referee(int game_length)
>         now = start;
>  
>         /* Start the game! */
> -       tst_atomic_store(0, &the_ball);
>         pthread_barrier_wait(&start_barrier);
> +       tst_atomic_store(0, &the_ball);
>         atrace_marker_write("sched_football", "Game_started!");
> 
> 
> We have to be sure that the defense has started before we clear the
> ball. Previously we had the loop that waited for the players to be ready
> before we called referee() function so all the players were ready when
> we cleared it.

Uff and we have to get the final ball position before we stop the
threads as well, otherwise there is always chance, that we may end up
moving the ball right after the high priority defence threads has been
stopped:

diff --git a/testcases/realtime/func/sched_football/sched_football.c b/testcases/realtime/func/sched_football/sched_football.c
index 0617bdb87..54317bed9 100644
--- a/testcases/realtime/func/sched_football/sched_football.c
+++ b/testcases/realtime/func/sched_football/sched_football.c
@@ -115,8 +115,8 @@ void referee(int game_length)
        now = start;

        /* Start the game! */
-       tst_atomic_store(0, &the_ball);
        pthread_barrier_wait(&start_barrier);
+       tst_atomic_store(0, &the_ball);
        atrace_marker_write("sched_football", "Game_started!");

        /* Watch the game */
@@ -125,14 +125,14 @@ void referee(int game_length)
                gettimeofday(&now, NULL);
        }

-       /* Stop the game! */
-       tst_atomic_store(1, &game_over);
-       atrace_marker_write("sched_football", "Game_Over!");
-
        /* Blow the whistle */
        final_ball = tst_atomic_load(&the_ball);
        tst_res(TINFO, "Final ball position: %d", final_ball);

+       /* Stop the game! */
+       tst_atomic_store(1, &game_over);
+       atrace_marker_write("sched_football", "Game_Over!");
+
        TST_EXP_EXPR(final_ball == 0);
 }


-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list