All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Furkan Caliskan <frn1furkan10@gmail.com>
Cc: andrew.cooper3@citrix.com, roger@xenproject.org,
	dfaggioli@suse.com, anthony.perard@vates.tech, julien@xen.org,
	sstabellini@kernel.org, gwd@xenproject.org, enr0n@ubuntu.com,
	michal.orzel@amd.com, xen-devel@lists.xenproject.org,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH 2/5] xen/sched: rtds: enforce admission control in xl sched-rtds
Date: Mon, 14 Sep 2026 11:21:32 +0200	[thread overview]
Message-ID: <ee7a2c47-d9ce-41ee-87fa-b76d71a81292@suse.com> (raw)
In-Reply-To: <e64415b8-f117-43d8-a977-8994650050c2@suse.com>

On 14.09.2026 11:16, Juergen Gross wrote:
> On 26.08.26 06:57, Furkan Caliskan wrote:
>> --- a/xen/common/sched/rt.c
>> +++ b/xen/common/sched/rt.c
>> @@ -1527,11 +1527,43 @@ rt_dom_cntl(
>>           op->u.rtds.budget = RTDS_DEFAULT_BUDGET / MICROSECS(1);
>>           break;
>>       case XEN_DOMCTL_SCHEDOP_putinfo:
>> +    {
>> +        uint64_t dom_old_util = 0, new_util, new_total;
>> +        unsigned int nr_units = 0;
>> +
>>           rc = rt_validate_params(&op->u.rtds, &period, &budget);
>>           if ( rc )
>>               break;
>>   
>> +        new_util = rt_unit_utilization(period, budget);
>> +
>>           spin_lock_irqsave(&prv->lock, flags);
>> +
>> +        /*
>> +         * Same (period, budget) for every unit of d: test and commit
>> +         * the domain's whole utilization delta atomically, rather
>> +         * than unit-by-unit, which could spuriously reject an
>> +         * overall-acceptable change depending on iteration order.
>> +         */
>> +        for_each_sched_unit ( d, unit )
>> +        {
>> +            svc = rt_unit(unit);
>> +            dom_old_util += rt_unit_utilization(svc->period, svc->budget);
>> +            nr_units++;
>> +        }
>> +
>> +        new_total = prv->utilization - dom_old_util +
>> +                    (uint64_t)nr_units * new_util;
>> +
>> +        if ( new_total > prv->utilization && new_total > rt_utilization_cap(d) )
>> +        {
>> +            rc = -EINVAL;
> 
> Is EINVAL a good choice here? I think a different error code might be wanted.
> 
>> +            spin_unlock_irqrestore(&prv->lock, flags);
>> +            break;
>> +        }

Additionally please unlock first, then set rc. The compiler may do such a
rearrangement, but it also may not.

Jan


  reply	other threads:[~2026-09-14  9:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  4:57 [PATCH 0/5] xen/sched: rtds: add per-cpupool admission control Furkan Caliskan
2026-08-26  4:57 ` [PATCH 1/5] xen/sched: rtds: add global-EDF utilization " Furkan Caliskan
2026-09-14  9:10   ` Juergen Gross
2026-09-14  9:13     ` Jan Beulich
2026-09-14  9:33       ` Jürgen Groß
2026-09-14  9:45         ` Jan Beulich
2026-09-14 10:34           ` Furkan Çalışkan
2026-09-14 11:29             ` Jan Beulich
2026-09-14 10:30     ` Furkan Çalışkan
2026-09-14 11:15     ` Furkan Çalışkan
2026-08-26  4:57 ` [PATCH 2/5] xen/sched: rtds: enforce admission control in xl sched-rtds Furkan Caliskan
2026-09-14  9:16   ` Juergen Gross
2026-09-14  9:21     ` Jan Beulich [this message]
2026-09-14 10:40     ` Furkan Çalışkan
2026-09-18  7:46       ` Jürgen Groß
2026-09-18  7:51         ` Furkan Çalışkan
2026-08-26  4:57 ` [PATCH 3/5] xen/sched: rtds: report utilization and cap via debug key Furkan Caliskan
2026-09-14  9:18   ` Juergen Gross
2026-08-26  4:57 ` [PATCH 4/5] xen/sched: rtds: make admission control cpupool-wide toggleable Furkan Caliskan
2026-08-26  6:14   ` Jan Beulich
2026-09-14 10:45     ` Furkan Çalışkan
2026-09-14  9:24   ` Juergen Gross
2026-08-26  4:57 ` [PATCH 5/5] tools: expose admission control toggle via xl sched-rtds Furkan Caliskan
2026-09-11 12:25 ` [PATCH 0/5] xen/sched: rtds: add per-cpupool admission control Furkan Çalışkan
2026-09-11 12:57   ` Jürgen Groß
2026-09-11 13:05     ` Furkan Çalışkan

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=ee7a2c47-d9ce-41ee-87fa-b76d71a81292@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=dfaggioli@suse.com \
    --cc=enr0n@ubuntu.com \
    --cc=frn1furkan10@gmail.com \
    --cc=gwd@xenproject.org \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.