Xenomai real-time core development
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Xenomai <xenomai@lists.linux.dev>
Subject: Re: [libevl][PATCH] tests: sched-quota: Synchronize all threads before readings stats
Date: Fri, 04 Sep 2026 11:21:32 +0200	[thread overview]
Message-ID: <87ik4lfk2r.fsf@xenomai.org> (raw)
In-Reply-To: <2776b343-0622-4f57-b806-094f0120b220@siemens.com> (Jan Kiszka's message of "Mon, 31 Aug 2026 15:30:14 +0200")

Jan Kiszka <jan.kiszka@siemens.com> writes:

> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> The quota threads may complete their work in a random order. Wait for
> them all first before starting to read out their stats. This avoids
> inconsistencies.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  tests/sched-quota-accuracy.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/sched-quota-accuracy.c b/tests/sched-quota-accuracy.c
> index 2a2dc38..1bf5eb9 100644
> --- a/tests/sched-quota-accuracy.c
> +++ b/tests/sched-quota-accuracy.c
> @@ -275,8 +275,9 @@ static struct accuracy_results run_quota(void)
>  	 * number of loops we should be able to run during the
>  	 * allotted quota, even in case of runtime disruption.
>  	 */
> -	for (n = 0, loops_at_calibration = 0; n < nrthreads; n++) {
> +	for (n = 0; n < nrthreads; n++)
>  		__Tcall_assert(ret, evl_get_sem(&ready));
> +	for (n = 0, loops_at_calibration = 0; n < nrthreads; n++) {
>  		do_trace("CPU%d: calibration: quota_thread[%d]: %llu loops",
>  			test_cpu, n, threads[n].loops);
>  		loops_at_calibration += threads[n].loops;
> @@ -292,8 +293,9 @@ static struct accuracy_results run_quota(void)
>  	 * Wait for the accuracy measurement to end, then collect the
>  	 * numbers.
>  	 */
> -	for (n = 0, loops_at_accuracy = 0; n < nrthreads; n++) {
> +	for (n = 0; n < nrthreads; n++)
>  		__Tcall_assert(ret, evl_get_sem(&ready));
> +	for (n = 0, loops_at_accuracy = 0; n < nrthreads; n++) {
>  		do_trace("CPU%d: accuracy: quota_thread[%d]: %llu loops",
>  			test_cpu, n, threads[n].loops);
>  		loops_at_accuracy += threads[n].loops;

Merged, thanks.

-- 
Philippe.

      reply	other threads:[~2026-09-04  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 13:30 [libevl][PATCH] tests: sched-quota: Synchronize all threads before readings stats Jan Kiszka
2026-09-04  9:21 ` Philippe Gerum [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=87ik4lfk2r.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@lists.linux.dev \
    /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