xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Sergey Dyasli <sergey.dyasli@citrix.com>
Cc: Wei Liu <wl@xen.org>, Andrew Cooper <Andrew.Cooper3@citrix.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>,
	Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Ian Jackson <Ian.Jackson@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-devel] xl vcpu-pin peculiarities in core scheduling mode
Date: Tue, 24 Mar 2020 15:22:33 +0100	[thread overview]
Message-ID: <af97b12c-e1f5-0278-8599-96264dc57101@suse.com> (raw)
In-Reply-To: <1585056853121.58010@citrix.com>

On 24.03.20 14:34, Sergey Dyasli wrote:
> Hi Juergen,
> 
> I've notived there is no documentation about how vcpu-pin is supposed to work
> with core scheduling enabled. I did some experiments and noticed the following
> inconsistencies:
> 
>    1. xl vcpu-pin 5 0 0
>       Windows 10 (64-bit) (1)              5     0    0   -b-    1644.0  0 / all
>       Windows 10 (64-bit) (1)              5     1    1   -b-    1650.1  0 / all
>                                                       ^                  ^
>       CPU 1 doesn't match reported hard-affinity of 0. Should this command set
>       hard-affinity of vCPU 1 to 1? Or should it be 0-1 for both vCPUs instead?
> 
> 
>    2. xl vcpu-pin 5 0 1
>       libxl: error: libxl_sched.c:62:libxl__set_vcpuaffinity: Domain 5:Setting vcpu affinity: Invalid argument
>       This is expected but perhaps needs documenting somewhere?
> 
> 
>    3. xl vcpu-pin 5 0 1-2
>       Windows 10 (64-bit) (1)              5     0    2   -b-    1646.7  1-2 / all
>       Windows 10 (64-bit) (1)              5     1    3   -b-    1651.6  1-2 / all
>                                                       ^                  ^^^
>       Here is a CPU / affinity mismatch again, but the more interesting fact
>       is that setting 1-2 is allowed at all, I'd expect CPU would never be set
>       to 1 with such settings.
> 
> Please let me know what you think about the above cases.

I think all of the effects can be explained by the way how pinning with
core scheduling is implemented. This does not mean that the information
presented to the user shouldn't be adapted.

Basically pinning of any vcpu will just affect the "master"-vcpu of a
virtual core (sibling 0). It will happily accept any setting as long as
any "master"-cpu of a core is in the resulting set of cpus.

All vcpus of a virtual core share the same pinnings.

I think this explains all of the above scenarios.

IMO there are the following possibilities for reporting those pinnings
to the user:

1. As today, documenting the output.
    Not very nice IMO, but the least effort.

2. Just print one line for each virtual cpu/core/socket, like:
    Windows 10 (64-bit) (1)    5     0-1   0-1   -b-    1646.7  0-1 / all
    This has the disadvantage of dropping the per-vcpu time in favor of
    per-vcore time, OTOH this is reflecting reality.

3. Print the effective pinnings:
    Windows 10 (64-bit) (1)    5     0     0     -b-    1646.7  0   / all
    Windows 10 (64-bit) (1)    5     1     1     -b-    1646.7  1   / all
    Should be rather easy to do.

Thoughts?


Juergen


  reply	other threads:[~2020-03-24 14:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 13:34 [Xen-devel] xl vcpu-pin peculiarities in core scheduling mode Sergey Dyasli
2020-03-24 14:22 ` Jürgen Groß [this message]
2020-03-24 14:55   ` Dario Faggioli

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=af97b12c-e1f5-0278-8599-96264dc57101@suse.com \
    --to=jgross@suse.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=dfaggioli@suse.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=wl@xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).