All of lore.kernel.org
 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 2/2] tests: sched-quota-accuracy: Add preempting FIFO thread
Date: Mon, 20 Jul 2026 20:48:27 +0200	[thread overview]
Message-ID: <87mrvlebus.fsf@xenomai.org> (raw)
In-Reply-To: <87o6ghlulu.fsf@xenomai.org> (Philippe Gerum's message of "Wed, 08 Jul 2026 11:05:17 +0200")

Philippe Gerum <rpm@xenomai.org> writes:

> Jan Kiszka <jan.kiszka@siemens.com> writes:
>
>> On 20.06.26 14:40, Jan Kiszka wrote:
>>> On 20.06.26 13:17, Philippe Gerum wrote:
>>>> Philippe Gerum <rpm@xenomai.org> writes:
>>>>
>>>>> Jan Kiszka <jan.kiszka@siemens.com> writes:
>>>>>
>>>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>>>
>>>>>> Test that higher-prio SCHED_FIFO threads do not run on the bill of
>>>>>> SCHED_QUOTA threads and that their accounting is not otherwise
>>>>>> disturbed.
>>>>>>
>>>>>
>>>>> This patch introduced a regression when determining the accuracy of the
>>>>> policy with respect to allotting threads the expected runtime budget:
>>>>>
>>>>> root@phytec-mira-evl:~# evl test sched-quota-accuracy
>>>>> sched-quota-accuracy: 494.0%
>>>>>
>>>>> The proper result would rather be close to the following:
>>>>>
>>>>> root@phytec-mira-evl:~# evl test sched-quota-accuracy
>>>>> sched-quota-accuracy: 99.1%
>>>>
>>>> Ok, I guess the fact that the calibration process does not factor in the
>>>> disruptor explains the full breakage we have with the accounting now:
>>>>
>>>> root@phytec-mira-evl:~# evl test sched-quota-accuracy -- -v
>>>> picked CPU1 for execution
>>>> CPU1: calibrating: 893547 loops/sec
>>>> CPU1: new thread group #0, quota sum is 10%
>>>> CPU1: done quota_thread[0], count=150399
>>>> CPU1: done quota_thread[1], count=145636
>>>> CPU1: done quota_thread[2], count=141552
>>>> CPU1: 3 threads: cap=10%, effective=49.0%, disruption=49.6%
>>>> sched-quota-accuracy: 489.7%
>>>>
>>>> Which does not make any sense since the effective value should be capped
>>>> at 10% in the above case, compared to the nominal (full) report which
>>>> should be:
>>>>
>>>> root@phytec-mira-evl:~# evl test sched-quota-accuracy -- -v
>>>> picked CPU1 for execution
>>>> CPU1: calibrating: 899203 loops/sec
>>>> CPU1: new thread group #0, quota sum is 10%
>>>> CPU1: done quota_thread[0], count=26818
>>>> CPU1: done quota_thread[1], count=26709
>>>> CPU1: done quota_thread[2], count=35612
>>>> CPU1: 3 threads: cap=10%, effective=9.9%
>>>> sched-quota-accuracy: 99.1%
>>>>
>>>> Dropping this patch from the -next branch for now.
>>>>
>>> 
>>> I would rather recommend taking a trace and debugging the scheduler -
>>> this could very likely be remaining issue in the quota fix.
>>> 
>>
>> What is the state of this? How can I reproduce the issue you saw? What
>> is specific to the target, what could also be seen over qemu[/kvm]?
>>
>
> The task of writing a proper test for evl is ongoing, the overall sched
> issue is very much on my radar. I'll follow up when this test code is
> available.

You need to pick e5e876da..3e32fa6f from [1] for the kernel bits, and
198a21b7..HEAD from [2] for an improved sched-quota-accuracy test which
also measures the preemption noise, with a significantly simpler
implementation. The topmost commits in [2] also introduce an interface
to the ftrace-based 'evl_trace' event which I used for debugging.

Basically, I merged the gist of our past proposals, refining here and
there as issues were uncovered.

Heavily tested on real hardware, which uncovered a couple of other
serious issues. I plan to write a separate test program for testing the
runtime credit and peak management.

[1]
https://gitlab.com/Xenomai/xenomai4/linux-evl/-/commits/next/v6.12.y-cip-evl-rebase?ref_type=heads

[2] https://gitlab.com/Xenomai/xenomai4/libevl/-/commits/next?ref_type=heads

-- 
Philippe.

      reply	other threads:[~2026-07-20 18:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-14 19:36 [libevl][PATCH 1/2] tests: sched-quota-accuracy: Augment workload with busy-spinning Jan Kiszka
2026-06-14 19:37 ` [libevl][PATCH 2/2] tests: sched-quota-accuracy: Add preempting FIFO thread Jan Kiszka
2026-06-16  6:09   ` Philippe Gerum
2026-06-20 10:41   ` Philippe Gerum
2026-06-20 11:17     ` Philippe Gerum
2026-06-20 12:40       ` Jan Kiszka
2026-07-08  8:03         ` Jan Kiszka
2026-07-08  9:05           ` Philippe Gerum
2026-07-20 18:48             ` 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=87mrvlebus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.