From: Jan Beulich <jbeulich@suse.com>
To: "Furkan Çalışkan" <frn1furkan10@gmail.com>
Cc: jgross@suse.com, andrew.cooper3@citrix.com, dfaggioli@suse.com,
gwd@xenproject.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 1/2] xen/sched: core: skip missing vcpu slots in sched_move_domain()
Date: Wed, 19 Aug 2026 09:35:24 +0200 [thread overview]
Message-ID: <997d00e8-912d-4835-952c-d2912b3f1aaf@suse.com> (raw)
In-Reply-To: <0200ea9a-c1e3-46fc-bb7a-d50c39b38b92@gmail.com>
On 19.08.2026 09:28, Furkan Çalışkan wrote:
>
>
> On 8/19/26 09:53, Jan Beulich wrote:
>> On 19.08.2026 07:15, Furkan Caliskan wrote:
>>> --- a/xen/common/sched/core.c
>>> +++ b/xen/common/sched/core.c
>>> @@ -745,6 +745,38 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
>>>
>>> for ( unit_idx = 0; unit_idx < n_units; unit_idx++ )
>>> {
>>> + /*
>>> + * A vcpu slot can be missing if creation failed partway
>>> + * through. A dying domain is being torn down regardless, so
>>> + * skip the unit -- but a domain that isn't dying still needs
>>> + * every vcpu it has schedulable, so fail instead of silently
>>> + * dropping some of them.
>>> + */
>>> + bool vcpu_failed = false;
>>> +
>>> + for ( unsigned int i = 0;
>>> + i < gran && unit_idx * gran + i < d->max_vcpus; i++ )
>>> + {
>>> + if ( !d->vcpu[unit_idx * gran + i] )
>>
>> Is there a particular reason domain_vcpu() cannot be used here?
>
> We still need to guard against d->max_vcpus so that out-of-bounds
> indices in a partially filled unit don't get treated as missing
> vCPUs by domain_vcpu() returning NULL.
Ah, right - the bounds check cannot really be folded here. Then ...
> However, domain_vcpu(unit_idx * gran + i) can be used here instead of
> d->vcpu[unit_idx * gran + i]. I simply used d->vcpu[] because the rest
> of the function uses it that way.
... best wait for Jürgen to comment. Outside of the scheduler we're
trying to replace open-coding of domain_vcpu(), but inside the
scheduler things may be different.
Jan
next prev parent reply other threads:[~2026-08-19 7:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 5:15 [PATCH v2 0/2] xen/sched: fix crashes when vcpu creation fails Furkan Caliskan
2026-08-19 5:15 ` [PATCH v2 1/2] xen/sched: core: skip missing vcpu slots in sched_move_domain() Furkan Caliskan
2026-08-19 6:53 ` Jan Beulich
2026-08-19 7:28 ` Furkan Çalışkan
2026-08-19 7:35 ` Jan Beulich [this message]
2026-08-28 12:45 ` Juergen Gross
2026-08-28 13:15 ` Furkan Çalışkan
2026-08-19 5:15 ` [PATCH v2 2/2] xen/sched: core: kill unarmed timers on sched_init_vcpu() failure Furkan Caliskan
2026-08-19 7:22 ` Jan Beulich
2026-08-19 7:53 ` Furkan Çalışkan
2026-08-19 8:32 ` Jan Beulich
2026-08-19 8:50 ` Furkan Çalışkan
2026-08-19 10:39 ` Furkan Çalışkan
2026-08-19 10:43 ` Jan Beulich
2026-08-28 15:14 ` Jürgen Groß
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=997d00e8-912d-4835-952c-d2912b3f1aaf@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=dfaggioli@suse.com \
--cc=frn1furkan10@gmail.com \
--cc=gwd@xenproject.org \
--cc=jgross@suse.com \
--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.