[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQOZAtXtD023n5sc@gpd4>
Date: Thu, 30 Oct 2025 17:57:38 +0100
From: Andrea Righi <arighi@...dia.com>
To: Christian Loehle <christian.loehle@....com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Valentin Schneider <vschneid@...hat.com>, Tejun Heo <tj@...nel.org>,
	David Vernet <void@...ifault.com>,
	Changwoo Min <changwoo@...lia.com>, Shuah Khan <shuah@...nel.org>,
	Joel Fernandes <joelagnelf@...dia.com>,
	Emil Tsalapatis <emil@...alapatis.com>,
	Luigi De Matteis <ldematteis123@...il.com>,
	sched-ext@...ts.linux.dev, bpf@...r.kernel.org,
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/11] selftests/sched_ext: Add test for sched_ext
 dl_server
Hi Christian,
On Thu, Oct 30, 2025 at 04:49:48PM +0000, Christian Loehle wrote:
> On 10/29/25 19:08, Andrea Righi wrote:
> > Add a selftest to validate the correct behavior of the deadline server
> > for the ext_sched_class.
> > 
> > v3: - add a comment to explain the 4% threshold (Emil Tsalapatis)
> > v2: - replaced occurences of CFS in the test with EXT (Joel Fernandes)
> > 
> > Reviewed-by: Emil Tsalapatis <emil@...alapatis.com>
> > Co-developed-by: Joel Fernandes <joelagnelf@...dia.com>
> > Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
> > Signed-off-by: Andrea Righi <arighi@...dia.com>
> > ---
...
> I'd still prefer something like the below to also test if the
> fair_server stop -> ext_server start -> fair_server start -> ext_server stop
> flow works correctly, but FWIW
> Tested-by: Christian Loehle <christian.loehle@....com>
Ack, I'll also run some tests on my side with this applied.
And yes, this definitely improves the selftest. I think we can also apply
it as a follow-up patch later.
Thanks,
-Andrea
> 
> 
> ------8<------
> @@ -188,19 +188,24 @@ static bool sched_stress_test(void)
>  static enum scx_test_status run(void *ctx)
>  {
>         struct rt_stall *skel = ctx;
> -       struct bpf_link *link;
> +       struct bpf_link *link = NULL;
>         bool res;
>  
> -       link = bpf_map__attach_struct_ops(skel->maps.rt_stall_ops);
> -       SCX_FAIL_IF(!link, "Failed to attach scheduler");
> -
> -       res = sched_stress_test();
> -
> -       SCX_EQ(skel->data->uei.kind, EXIT_KIND(SCX_EXIT_NONE));
> -       bpf_link__destroy(link);
> -
> -       if (!res)
> -               ksft_exit_fail();
> +       for (int i = 0; i < 4; i++) {
> +               if (i % 2) {
> +                       memset(&skel->data->uei, 0, sizeof(skel->data->uei));
> +                       link = bpf_map__attach_struct_ops(skel->maps.rt_stall_ops);
> +                       SCX_FAIL_IF(!link, "Failed to attach scheduler");
> +               }
> +               res = sched_stress_test();
> +               if (i % 2) {
> +                       SCX_EQ(skel->data->uei.kind, EXIT_KIND(SCX_EXIT_NONE));
> +                       bpf_link__destroy(link);
> +               }
> +
> +               if (!res)
> +                       ksft_exit_fail();
> +       }
>  
>         return SCX_TEST_PASS;
>  }
> 
Powered by blists - more mailing lists
 
