Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] sched_football: synchronize with kickoff flag to reduce skew
Date: Thu, 4 Sep 2025 20:26:59 +0200	[thread overview]
Message-ID: <20250904182659.GA4056@pevik> (raw)
In-Reply-To: <CAEemH2f=6MRZTk95ZctgPG-MKdyw5oK9WNgh3Tm8WNHQ9NcW_g@mail.gmail.com>

Hi,


> On Thu, Sep 4, 2025 at 7:42 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> > Hi!
> > > >  static void do_setup(void)
> > > >  {
> > > > +   if (!tst_check_preempt_rt())
> > > > +           tst_brk(TCONF, "Test requires real-time kernel");

> > > I understood Cyril is really suggesting to keep it [1]. I would also
> > vote to
> > > keep it (we still have some time to see if it got fixed before release).

> > > I know we had this discussion in the past (some of your colleague
> > suggesting it
> > > should not be run on non-RT kernel), so I'm not pushing for it.

> > I stil do not understand reasons for disabling the test. The POSIX
> > realtime schedulling classes have to work properly regardless of the
> > kernel flavor. Why should we turn the test off on non-rt kernel then?


> No special reasons. I still can sporadically catch the failure on non-RT
> kernel with even sleep 2 seconds.

> Thus, I took this very extreme approach, because on non-RT kernel, sleep
> may not have a particularly perfect effect, I guess the stock kernel with
> sched_setscheduler(, SCHED_FIFO, ) is still has scheduling skew with
> workload.

> But the RT kernel is more aggressive in scheduling, and it is almost
> impossible
> to encounter false positives with that enhancement.


> --- a/testcases/realtime/func/sched_football/sched_football.c
> +++ b/testcases/realtime/func/sched_football/sched_football.c
> @@ -130,6 +130,8 @@ void referee(int game_length)
>         pthread_barrier_wait(&start_barrier);
>         tst_atomic_store(0, &the_ball);
>         tst_atomic_store(1, &kickoff_flag);
> +       usleep(2000000);
	
> +

>         /* Watch the game */
>         while ((now.tv_sec - start.tv_sec) < game_length) {
> @@ -199,9 +201,6 @@ static void do_test(void)

>  static void do_setup(void)
>  {
> -       if (!tst_check_preempt_rt())
> -               tst_brk(TCONF, "Test requires real-time kernel");
> -
>         if (tst_parse_int(str_game_length, &game_length, 1, INT_MAX))
>                 tst_brk(TBROK, "Invalid game length '%s'", str_game_length);

> # ./sched_football
> tst_test.c:2004: TINFO: LTP version: 20250530
> tst_test.c:2007: TINFO: Tested kernel: 6.12.0-55.29.1.el10_0.x86_64
>                                   #1 SMP PREEMPT_DYNAMIC Mon Aug 18
> 05:37:24 EDT 2025 x86_64
> tst_kconfig.c:88: TINFO: Parsing kernel config
> '/lib/modules/6.12.0-55.29.1.el10_0.x86_64/config'
> tst_test.c:1825: TINFO: Overall timeout per run is 0h 00m 30s
> sched_football.c:162: TINFO: players_per_team: 32 game_length: 5
> sched_football.c:178: TINFO: Starting 32 offense threads at priority 15
> sched_football.c:185: TINFO: Starting 32 defense threads at priority 30
> sched_football.c:192: TINFO: Starting 64 crazy-fan threads at priority 50
> sched_football.c:118: TINFO: Starting referee thread
> sched_football.c:121: TINFO: Starting the game (5 sec)
> sched_football.c:144: TINFO: Final ball position: 16761
> sched_football.c:150: TFAIL: Expect: final_ball == 0

OK even 2 s sleep does not work. I'm out of ideas what in the test is wrong.

Kind regards,
Petr

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

      parent reply	other threads:[~2025-09-04 18:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 10:26 [LTP] [PATCH v2] sched_football: synchronize with kickoff flag to reduce skew Li Wang via ltp
2025-09-04 11:00 ` Petr Vorel
2025-09-04 11:42   ` Cyril Hrubis
2025-09-04 13:14     ` Li Wang via ltp
2025-09-04 15:28       ` Cyril Hrubis
2025-09-05  0:54         ` Li Wang via ltp
2025-09-05  4:03           ` Li Wang via ltp
2025-09-05  6:50             ` Li Wang via ltp
2025-09-05  7:03             ` Petr Vorel
2025-09-05  7:31               ` Petr Vorel
2025-09-05  7:36                 ` Li Wang via ltp
2025-09-05  9:18             ` Cyril Hrubis
2025-09-05 11:50               ` Li Wang via ltp
2025-09-05 12:32                 ` Cyril Hrubis
2025-09-05 12:46                   ` Petr Vorel
2025-09-06  0:58                     ` Li Wang via ltp
2025-09-05 12:49                   ` Li Wang via ltp
2025-09-05 13:45                     ` Cyril Hrubis
2025-09-05 14:48                       ` Li Wang via ltp
2025-09-04 18:26       ` Petr Vorel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250904182659.GA4056@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox