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-accuracy: Fix test cpu selection
Date: Fri, 28 Aug 2026 09:49:16 +0200	[thread overview]
Message-ID: <87tsoebs77.fsf@xenomai.org> (raw)
In-Reply-To: <a5498e33-54ca-4c7c-b260-3c8922685dfc@siemens.com> (Jan Kiszka's message of "Fri, 28 Aug 2026 07:46:27 +0200")

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

> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> pick_test_cpu() is adjusting test_cpu to the system's possibilities.
> That is 0 for a single-core machine, but it can also be something else
> on multicore machines if the OOB cpuset is restricted. And this causes
> the test to fail:
>
> sched-quota-accuracy: ** BROKEN
> ../tests/sched-quota-accuracy.c:96: FAILED: sched_setaffinity(0, sizeof(affinity), &affinity) (=Operation not permitted)
>
> Fixes: 245a2eac29eb ("tests: sched-quota-accuracy: extend measurement to preemption noise")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  tests/sched-quota-accuracy.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/tests/sched-quota-accuracy.c b/tests/sched-quota-accuracy.c
> index 2c4daed..2a2dc38 100644
> --- a/tests/sched-quota-accuracy.c
> +++ b/tests/sched-quota-accuracy.c
> @@ -389,15 +389,6 @@ int main(int argc, char *argv[])
>  	}
>  
>  	atexit((void (*)(void))cleanup_group);
> -	set_cpu_affinity();	/* All test threads inherit this. */
> -
> -	param.sched_priority = MAIN_PRIO;
> -	__Tcall_assert(ret, pthread_setschedparam(pthread_self(), SCHED_FIFO, &param));
> -	__Tcall_assert(ret, evl_attach_self("quota-accuracy:%d", getpid()));
> -
> -	__Tcall_assert(ret, evl_new_sem(&ready, "quota-ready:%d", getpid()));
> -	__Tcall_assert(ret, evl_new_event(&barrier, "quota-barrier:%d", getpid()));
> -	__Tcall_assert(ret, evl_new_mutex(&lock, "quota-lock:%d", getpid()));
>  
>  	/*
>  	 * We need all threads to be pinned on the same (oob-capable)
> @@ -407,6 +398,15 @@ int main(int argc, char *argv[])
>  	 */
>  	test_cpu = pick_test_cpu(test_cpu, false, NULL);
>  	do_trace("picked CPU%d for execution", test_cpu);
> +	set_cpu_affinity();	/* All test threads inherit this. */
> +
> +	param.sched_priority = MAIN_PRIO;
> +	__Tcall_assert(ret, pthread_setschedparam(pthread_self(), SCHED_FIFO, &param));
> +	__Tcall_assert(ret, evl_attach_self("quota-accuracy:%d", getpid()));
> +
> +	__Tcall_assert(ret, evl_new_sem(&ready, "quota-ready:%d", getpid()));
> +	__Tcall_assert(ret, evl_new_event(&barrier, "quota-barrier:%d", getpid()));
> +	__Tcall_assert(ret, evl_new_mutex(&lock, "quota-lock:%d", getpid()));
>  
>  	if (nrthreads <= 0)
>  		nrthreads = 3;

Merged, thanks.

-- 
Philippe.

      reply	other threads:[~2026-08-28  7:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28  5:46 [libevl][PATCH] tests: sched-quota-accuracy: Fix test cpu selection Jan Kiszka
2026-08-28  7:49 ` 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=87tsoebs77.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