Skip to contentSkip to conversation

LTP Release preparations

LTP Cyril Hrubis 5 participants 27 messages Sep 1, 2025 – Sep 26, 2025

lore
Share & tools
lore
#0 lore raw

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi!

Quoted 6 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Thanks. It would be nice to merge these patches before release:

- doc testing in CI: https://patchwork.ozlabs.org/project/ltp/list/?series=454189
- open_tree_attr() coverage: https://patchwork.ozlabs.org/project/ltp/list/?series=471820

Also @Ricardo has many patches sent which are waiting to be merged and some of them are interesting.

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 11 lines · Andrea Cervesato

Hi!

Quoted 6 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Thanks. It would be nice to merge these patches before release:

Quoted 7 lines

- doc testing in CI:
https://patchwork.ozlabs.org/project/ltp/list/?series=454189
- open_tree_attr() coverage:
https://patchwork.ozlabs.org/project/ltp/list/?series=471820

Also @Ricardo has many patches sent which are waiting to be merged and some of them are interesting.

There seems to be a glitch in patchwork... This submitter is not me:

https://patchwork.ozlabs.org/project/ltp/list/?submitter=77627

I only have pending lchown conversion and pthread_rwlock_rdlock fix:

https://patchwork.ozlabs.org/project/ltp/list/?series=471445
https://patchwork.ozlabs.org/project/ltp/list/?series=457701

Thanks !

Quoted 2 lines

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 20 lines · Ricardo B. Marlière
Quoted 11 lines · Andrea Cervesato

Hi!

Quoted 6 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Thanks. It would be nice to merge these patches before release:

Quoted 7 lines

- doc testing in CI:
https://patchwork.ozlabs.org/project/ltp/list/?series=454189
- open_tree_attr() coverage:
https://patchwork.ozlabs.org/project/ltp/list/?series=471820

Also @Ricardo has many patches sent which are waiting to be merged and some of them are interesting.

Quoted 8 lines

There seems to be a glitch in patchwork... This submitter is not me:

https://patchwork.ozlabs.org/project/ltp/list/?submitter=77627

I only have pending lchown conversion and pthread_rwlock_rdlock fix:

https://patchwork.ozlabs.org/project/ltp/list/?series=471445
https://patchwork.ozlabs.org/project/ltp/list/?series=457701

Actually I guess this one aswell:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Quoted 5 lines

Thanks !

Quoted 2 lines

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
In reply to Cyril Hrubis
Quoted 5 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Hi,
we still have the fix for OOM issues in memcontrol03 which is waiting for review since May. The proposal to fix the issue in the kernel by Michal went nowhere so we should probably fix the test.

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Signature · 10 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Hi!

Quoted 5 lines

we still have the fix for OOM issues in memcontrol03 which is waiting for review since May. The proposal to fix the issue in the kernel by Michal went nowhere so we should probably fix the test.

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Looking at the discussion the kernel patch wasn't accepted and we either have to pin all the processes to a single CPU or account for the overcharge. I guess either one is fine.

Shall I apply our patch or do we want to go the CPU pinning route?

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw
Quoted 5 lines · Cyril Hrubis

Looking at the discussion the kernel patch wasn't accepted and we either have to pin all the processes to a single CPU or account for the overcharge. I guess either one is fine.

Shall I apply our patch or do we want to go the CPU pinning route?

Let's go with the existing patch. We run the test on a VM with only 2 CPUs so pinning on 64K page system will still result in 2MB overcharge for in-kernel cgroup structures.

Signature · 10 lines
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw
In reply to Cyril Hrubis

Hi!

Quoted 6 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

We are facing an issue related to sched_football test after the following patch introduced:

https://lore.kernel.org/ltp/[email protected]/

Test started to fail quite often in SUSE distros, while before it was working fine: https://openqa.opensuse.org/tests/5283668#step/sched_football/6

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?

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#8 lore raw

Hi!

Quoted 10 lines
Quoted 5 lines

It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

We are facing an issue related to sched_football test after the following patch introduced:

https://lore.kernel.org/ltp/[email protected]/

Quoted 7 lines

Test started to fail quite often in SUSE distros, while before it was working fine:
https://openqa.opensuse.org/tests/5283668#step/sched_football/6

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:

testcases/realtime/func/sched_football/sched_football.c +1 -1
index 0617bdb87..0d64210b0 100644
@@ -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.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#18 lore raw
In reply to Cyril Hrubis

Hi all,

Quoted 5 lines

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Cyril, I'd like to contribute 2 IMA fixes. Hopefully I'll send the patch this week on early next week.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#9 lore raw
In reply to Cyril Hrubis

Hi!

Quoted 20 lines
Quoted 3 lines

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:

testcases/realtime/func/sched_football/sched_football.c +1 -1
index 0617bdb87..0d64210b0 100644
@@ -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!");
 
 
Quoted 4 lines

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:

testcases/realtime/func/sched_football/sched_football.c +5 -5
index 0617bdb87..54317bed9 100644
@@ -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);
 }
 
Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#19 lore raw
In reply to Petr Vorel

Hi!

Quoted 7 lines
Quoted 4 lines

It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Cyril, I'd like to contribute 2 IMA fixes. Hopefully I'll send the patch this week on early next week.

Ack, that should be doable.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#10 lore raw
In reply to Cyril Hrubis

Hi Cyril, Andrea,

Quoted 24 lines · Cyril Hrubis

Hi!

Quoted 1 line
Quoted 1 line

After an analysis we are now sure that it's not a product bug but a

test

Review

Quoted 7 lines
Quoted 2 lines

issue. There might be a need to fallback the patch if we can't fix the test before release. @Li WDYT?

Try this:

(quoted diff) +0 -0

b/testcases/realtime/func/sched_football/sched_football.c

Quoted 13 lines

index 0617bdb87..0d64210b0 100644

testcases/realtime/func/sched_football/sched_football.c +1 -1
@@ -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!");
 
 
Quoted 10 lines
Quoted 4 lines

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:

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

So, based on this improve, we might need additional spin for all player threads (offense, defense, fans) wait at the barrier and then spin until the referee kicks off the ball.

testcases/realtime/func/sched_football/sched_football.c +10 -0
@@ -44,6 +44,7 @@
 static tst_atomic_t the_ball;
 static int players_per_team = 0;
 static int game_length = DEF_GAME_LENGTH;
+static tst_atomic_t kickoff_flag;
 static tst_atomic_t game_over;
 
 static char *str_game_length;
@@ -55,6 +56,9 @@ void *thread_fan(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "crazy_fan", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*occasionally wake up and run across the field */
        while (!tst_atomic_load(&game_over)) {
                struct timespec start, stop;
@@ -80,6 +84,9 @@ void *thread_defense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "defense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*keep the ball from being moved */
        while (!tst_atomic_load(&game_over)) {
        }
@@ -92,6 +99,9 @@ void *thread_offense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "offense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        while (!tst_atomic_load(&game_over)) {
                tst_atomic_add_return(1, &the_ball); /* move the ball ahead

one yard */

        }
@@ -115,9 +125,10 @@ void referee(int game_length)
        now = start;

        /* Start the game! */
-       tst_atomic_store(0, &the_ball);
-       pthread_barrier_wait(&start_barrier);
        atrace_marker_write("sched_football", "Game_started!");
+       pthread_barrier_wait(&start_barrier);
+       tst_atomic_store(0, &the_ball);
+       tst_atomic_store(1, &kickoff_flag);
        /* Watch the game */
        while ((now.tv_sec - start.tv_sec) < game_length) {
@@ -125,14 +136,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);

}

@@ -154,6 +165,7 @@ static void do_test(void)

        /* We're the ref, so set our priority right */
        param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 80;
        sched_setscheduler(0, SCHED_FIFO, &param);

+ tst_atomic_store(0, &kickoff_flag);

/*
* Start the offense

Quoted 44 lines
testcases/realtime/func/sched_football/sched_football.c +5 -6
index 0617bdb87..54317bed9 100644
@@ -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
[email protected]

--
Mailing list info: https://lists.linux.it/listinfo/ltp

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#11 lore raw
Quoted 40 lines · Li Wang

Hi Cyril, Andrea,

Quoted 25 lines · Cyril Hrubis

Hi!

Quoted 1 line
Quoted 1 line

After an analysis we are now sure that it's not a product bug but a

test

Quoted 1 line
Quoted 1 line

issue. There might be a need to fallback the patch if we can't fix

the

Review

Quoted 6 lines
Quoted 1 line

test before release. @Li WDYT?

Try this:

(quoted diff) +0 -0

b/testcases/realtime/func/sched_football/sched_football.c

Quoted 13 lines

index 0617bdb87..0d64210b0 100644

testcases/realtime/func/sched_football/sched_football.c +1 -1
@@ -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!");
 
 
Quoted 10 lines
Quoted 4 lines

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:

Quoted 8 lines

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

Sorry typo, RT --> non-RT kernels.

Since regular kernels use the CFS scheduler, which is more likely to have such deviations, I thought it would be better to run this test using the RT kernel.

After looking your test job, it appears that 6.16.3-1-default is a stock kernel,
so I'm not surprised by the failure.

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#12 lore raw

Hi Li,

Quoted 60 lines · Li Wang

On Thu, Sep 4, 2025 at 10:39 AM Li Wang <[email protected]> wrote:

Hi Cyril, Andrea,

On Wed, Sep 3, 2025 at 9:20 PM Cyril Hrubis <[email protected]> wrote:

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:

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking
thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

Quoted 12 lines

Sorry typo, RT --> non-RT kernels.

Since regular kernels use the CFS scheduler, which is more likely to have such deviations, I thought it would be better to run this test using the RT kernel.

Afterlooking your test job, it appears that 6.16.3-1-default is a stock kernel, so I'm not surprised by the failure.

Signature · 2 lines
Regards,
Li Wang

I see, are you planning to send a patch to fix the test?

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#13 lore raw
Quoted 67 lines · Andrea Cervesato

Hi Li,
On 9/4/25 5:06 AM, Li Wang wrote:

Quoted 41 lines · Li Wang

Hi Cyril, Andrea,

Quoted 28 lines · Cyril Hrubis

Hi!

Quoted 1 line
Quoted 1 line

After an analysis we are now sure that it's not a product bug but a

test

Quoted 1 line
Quoted 1 line

issue. There might be a need to fallback the patch if we can't fix

the

Review

Quoted 6 lines
Quoted 1 line

test before release. @Li WDYT?

Try this:

(quoted diff) +0 -0

b/testcases/realtime/func/sched_football/sched_football.c

Quoted 13 lines

index 0617bdb87..0d64210b0 100644

testcases/realtime/func/sched_football/sched_football.c +1 -1
@@ -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!");
 
 
Quoted 2 lines

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

Quoted 8 lines
Quoted 2 lines

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:

Quoted 8 lines

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

Sorry typo, RT --> non-RT kernels.

Since regular kernels use the CFS scheduler, which is more likely to have such deviations, I thought it would be better to run this test using the RT kernel.

After looking your test job, it appears that 6.16.3-1-default is a stock kernel,
so I'm not surprised by the failure.

Quoted 6 lines

--
Regards,
Li Wang

I see, are you planning to send a patch to fix the test?

Yes, I will send a strengthened patch based on Cyril's method.

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#14 lore raw
Quoted 1 line · Li Wang

Yes, I will send a strengthened patch based on Cyril's method.

Thank you! Looking forward :)

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#15 lore raw
In reply to Li Wang via ltp

Hi!

Quoted 7 lines

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

I guess that there is no defined order in which the threads are woken up after the sleep on the barrier. Hence if we wake up the low prio thread by a chance before all the high prio threads are awake they manage to do a few cycles.

Quoted 46 lines

So, based on this improve, we might need additional spin for all player threads (offense, defense, fans) wait at the barrier and then spin until the referee kicks off the ball.

testcases/realtime/func/sched_football/sched_football.c +10 -0
@@ -44,6 +44,7 @@
 static tst_atomic_t the_ball;
 static int players_per_team = 0;
 static int game_length = DEF_GAME_LENGTH;
+static tst_atomic_t kickoff_flag;
 static tst_atomic_t game_over;
 
 static char *str_game_length;
@@ -55,6 +56,9 @@ void *thread_fan(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "crazy_fan", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*occasionally wake up and run across the field */
        while (!tst_atomic_load(&game_over)) {
                struct timespec start, stop;
@@ -80,6 +84,9 @@ void *thread_defense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "defense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*keep the ball from being moved */
        while (!tst_atomic_load(&game_over)) {
        }
@@ -92,6 +99,9 @@ void *thread_offense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "offense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        while (!tst_atomic_load(&game_over)) {
                tst_atomic_add_return(1, &the_ball); /* move the ball ahead

one yard */

        }

testcases/realtime/func/sched_football/sched_football.c void referee(int game_length) · line 131

Quoted 9 lines
testcases/realtime/func/sched_football/sched_football.c +3 -2
@@ -115,9 +125,10 @@ void referee(int game_length)
        now = start;
 
        /* Start the game! */
-       tst_atomic_store(0, &the_ball);
-       pthread_barrier_wait(&start_barrier);
        atrace_marker_write("sched_football", "Game_started!");
+       pthread_barrier_wait(&start_barrier);
+       tst_atomic_store(0, &the_ball);
+       tst_atomic_store(1, &kickoff_flag);

Is this really 100% buletproof? Now the threads are going to wait for the referee for the kick off but if the referee is the first thread to be woken up after the barrier the order is stil not guaranteed.

Maybe we can just do a short sleep here in order to make sure that the scheduller kicks in and redistributes the threads. I would say something as 20ms (since with CONFIG_HZ=100 we have scheduller ticks every 10ms).

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#16 lore raw
Quoted 9 lines · Cyril Hrubis

Hi!

Quoted 7 lines

This makes sense! However, from my extensive testing, I still see occasional fails on KVM/Debug platforms.

I suspect the existing barriers ensure all threads are created before the game starts, but small scheduler skews can still allow the attacking thread to run for a few cycles before the defending thread migrates, especially on debug/RT kernels.

Quoted 5 lines

I guess that there is no defined order in which the threads are woken up after the sleep on the barrier. Hence if we wake up the low prio thread by a chance before all the high prio threads are awake they manage to do a few cycles.

Yes that's my concern as well. So that's why we need a busy-wait for each player before the real kick off.

Quoted 50 lines
Quoted 36 lines

So, based on this improve, we might need additional spin for all player threads (offense, defense, fans) wait at the barrier and then spin until the referee kicks off the ball.

testcases/realtime/func/sched_football/sched_football.c +7 -0
@@ -44,6 +44,7 @@
 static tst_atomic_t the_ball;
 static int players_per_team = 0;
 static int game_length = DEF_GAME_LENGTH;
+static tst_atomic_t kickoff_flag;
 static tst_atomic_t game_over;
 
 static char *str_game_length;
@@ -55,6 +56,9 @@ void *thread_fan(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "crazy_fan", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*occasionally wake up and run across the field */
        while (!tst_atomic_load(&game_over)) {
                struct timespec start, stop;
@@ -80,6 +84,9 @@ void *thread_defense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "defense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        /*keep the ball from being moved */
        while (!tst_atomic_load(&game_over)) {
        }

testcases/realtime/func/sched_football/sched_football.c void *thread_offense(void *arg LTP_ATTRIBUTE_UNUSED) · line 106

Quoted 8 lines
testcases/realtime/func/sched_football/sched_football.c +3 -0
@@ -92,6 +99,9 @@ void *thread_offense(void *arg LTP_ATTRIBUTE_UNUSED)
 {
        prctl(PR_SET_NAME, "offense", 0, 0, 0);
        pthread_barrier_wait(&start_barrier);
+       while (!tst_atomic_load(&kickoff_flag))
+               ;
+
        while (!tst_atomic_load(&game_over)) {
                tst_atomic_add_return(1, &the_ball); /* move the ball

ahead

Quoted 5 lines

one yard */

        }
testcases/realtime/func/sched_football/sched_football.c +0 -0
@@ -115,9 +125,10 @@ void referee(int game_length)
        now = start;
 
Quoted 12 lines

testcases/realtime/func/sched_football/sched_football.c void referee(int game_length) · line 131

Quoted 7 lines
testcases/realtime/func/sched_football/sched_football.c +3 -2
        /* Start the game! */
-       tst_atomic_store(0, &the_ball);
-       pthread_barrier_wait(&start_barrier);
        atrace_marker_write("sched_football", "Game_started!");
+       pthread_barrier_wait(&start_barrier);
+       tst_atomic_store(0, &the_ball);
+       tst_atomic_store(1, &kickoff_flag);

Is this really 100% buletproof? Now the threads are going to wait for the referee for the kick off but if the referee is the first thread to be woken up after the barrier the order is stil not guaranteed.

No it's not a 100% guarantee.

Quoted 3 lines

Maybe we can just do a short sleep here in order to make sure that the scheduller kicks in and redistributes the threads. I would say something as 20ms (since with CONFIG_HZ=100 we have scheduller ticks every 10ms).

Good point, this will increase the chances of every player being active before the kickoff.

So patch v2 should add one line here, right?

    usleep(20000);
Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#17 lore raw

Hi!

Quoted 5 lines

Good point, this will increase the chances of every player being active before the kickoff.

So patch v2 should add one line here, right?

    usleep(20000);

Yes please. With that it should work fine everywhere, as long as the scheduller manages to distribute the processes between CPUs in a single scheduller tick. The original code did sleep(2) so if we stil see failures with 20ms I was just too optimistic and we may need to increase that.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#20 lore raw
In reply to Cyril Hrubis

Hi Cyril,

Quoted 6 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

This is a patch that would be nice to merge inside the new release, since it's breaking reviews: https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

- Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#21 lore raw
In reply to Cyril Hrubis
Quoted 5 lines · Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

I would like add fix for current openqa failed case cpuset02. Futher more fix is simple and should not trigger side effect.
https://patchwork.ozlabs.org/project/ltp/cover/[email protected]/
Thanks.

Quoted 7 lines
Signature · 6 lines
-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#23 lore raw
In reply to Cyril Hrubis
Quoted 7 lines · CEST Cyril Hrubis

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Hi,

I sent a patch [1] for using tst_kconfig_check() for the tests which are affected by new POSIX_AUX_CLOCKS=y config. I guess it should be included in the release.

Thanks,
Avinesh

[1] https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#22 lore raw
In reply to Wei Gao via ltp

Hi all,

Quoted 10 lines · Cyril Hrubis
Quoted 5 lines

Hi!
It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

I would like add fix for current openqa failed case cpuset02. Futher more fix is simple and should not trigger side effect.
https://patchwork.ozlabs.org/project/ltp/cover/[email protected]/
Thanks.

Also Wei's patch for ioctl_loop01.c [1] is IMHO worth to get into the release.

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#24 lore raw
In reply to Cyril Hrubis

Hi Cyril, Petr,

Cyril Hrubis <[email protected]> wrote:

Hi!

Quoted 5 lines

It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

LTP pre-release test looks good on our latest RHEL 9/10 series. Just few minor errors that need the following two fix patches:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Note: Next week is our public holiday (7days), so I may not be able to reply to emails in time.

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#25 lore raw

Hi Li, Cyril, all,

Quoted 12 lines

Hi Cyril, Petr,

Cyril Hrubis <[email protected]> wrote:

Hi!

Quoted 4 lines

It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Quoted 5 lines

LTP pre-release test looks good on our latest RHEL 9/10 series. Just few minor errors that need the following two fix patches:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Thanks a lot for your testing. Both of these were fixed.

Quoted 2 lines

Note: Next week is our public holiday (7days), so I may not be able to reply to emails in time.

Enjoy your free time :).

All: I guess that's all for the release.

I'd vote for applying LTP_QUIET patch:
https://lore.kernel.org/ltp/[email protected]/

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#26 lore raw

Hi!

Quoted 13 lines
Quoted 7 lines
Quoted 4 lines

It's about the time we start to prepare for the September release. As usuall I will go over the patches in the patchwork in the next week or two. If there is something that you think should be part of the release, please point it out so that I can have a look ASAP.

Quoted 5 lines

LTP pre-release test looks good on our latest RHEL 9/10 series. Just few minor errors that need the following two fix patches:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Quoted 8 lines

Thanks a lot for your testing. Both of these were fixed.

Quoted 2 lines

Note: Next week is our public holiday (7days), so I may not be able to reply to emails in time.

Enjoy your free time :).

All: I guess that's all for the release.

I just merged to fixes from Martin and one from myself and there are a few more fixes I'm going to check and possibly apply.

Quoted 2 lines

I'd vote for applying LTP_QUIET patch:
https://lore.kernel.org/ltp/[email protected]/

That is stil in the queue as well.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp