public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Alessandro Carminati <acarmina@redhat.com>
Cc: Alessandro Carminati <alessandro.carminati@gmail.com>,
	ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] cfs-scheduler/starvation.c: Skip test on realtime kernels
Date: Mon, 20 Jan 2025 10:46:34 +0100	[thread overview]
Message-ID: <20250120094634.GB798022@pevik> (raw)
In-Reply-To: <20250120085017.63442-1-acarmina@redhat.com>

Hi Alessandro,

> This commit introduces a check in the starvation test case to detect and
> skip execution on realtime kernels. The test is designed for use with the
> Completely Fair Scheduler and produces meaningless results when run on
> realtime kernels.

> By skipping the test on realtime kernels, we avoid confusion caused by
> misleading results.

> Changes include:
> - Added a detection mechanism for realtime kernels.
> - Logic to skip the test execution if the kernel is identified as
>   realtime.

LGTM. Could you please test if starvation.c worked previously?
Or was it always broken?

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> +int tst_check_preempt_rt(void)
> +{
> +	struct utsname uval;
> +
> +	uname(&uval);
> +	if (strstr(uval.version, "PREEMPT_RT"))
> +		return -1;
> +	return 0;
> +}
> diff --git a/testcases/kernel/sched/cfs-scheduler/starvation.c b/testcases/kernel/sched/cfs-scheduler/starvation.c
> index 901556a7b..c620c9c3e 100644
> --- a/testcases/kernel/sched/cfs-scheduler/starvation.c
> +++ b/testcases/kernel/sched/cfs-scheduler/starvation.c
> @@ -82,6 +82,9 @@ static void setup(void)

>  	CPU_ZERO(&mask);

> +	if (tst_check_preempt_rt())
> +		tst_brk(TCONF, "This test is not designed for the RT kernel");
nit: I would move it above CPU_ZERO().

NOTE: we should also move tst_has_slow_kconfig() check to be at the top of
setup(). But that's unrelated. Also at least on Tumbleweed and SLES which get
detected as slow due CONFIG_LATENCYTOP test was worked before.

Kind regards,
Petr

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

  reply	other threads:[~2025-01-20  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20  8:50 [LTP] [PATCH] cfs-scheduler/starvation.c: Skip test on realtime kernels Alessandro Carminati
2025-01-20  9:46 ` Petr Vorel [this message]
2025-01-20 10:21   ` Alessandro Carminati
2025-01-21  8:56     ` Petr Vorel

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=20250120094634.GB798022@pevik \
    --to=pvorel@suse.cz \
    --cc=acarmina@redhat.com \
    --cc=alessandro.carminati@gmail.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