Skip to contentSkip to conversation

Xen: support maxvcpus in xm and xl config

PATCH Ian Campbell 3 participants 4 messages Dec 16, 2015 – Dec 19, 2015 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ian Campbell

author Acked-by Tested-by
#1 lore raw
Quoted 24 lines · Jim Fehlig

From: Ian Campbell <[email protected]>

xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail as a bit map of which cpus are online (default is all).

xend from 4.0 onwards understands maxvcpus as maxvcpus and vcpus as the number which are online (from 0..N-1). The upstream commit (68a94cf528e6 "xm: Add maxvcpus support") claims that if maxvcpus is omitted then the old behaviour (i.e. obeying vcpu_avail) is retained, but AFAICT it was not, in this case vcpu==maxcpus==online cpus. This is good for us because handling anything else would be fiddly.

This patch changes parsing of the virDomainDef maxvcpus and vcpus entries to use the corresponding 'maxvcpus' and 'vcpus' settings from xm and xl config. It also drops use of the old Xen 3.x 'vcpu_avail' setting.

The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since maxvcpus is simply a count, not a bit mask), which is particularly crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are expected to support vcpu placement, and therefore only the boot vcpu's info lives in the shared info page).

Quoted 4 lines

Existing tests adjusted accordingly, and new tests added for the 'maxvcpus' setting.

(as far as "domxml-from-native xen-xl" goes, I seem to have another issue actually starting a domain on ARM, which I'll investigate...)

#2 lore raw
Quoted 28 lines · Ian Campbell
Quoted 27 lines · Jim Fehlig

From: Ian Campbell <[email protected]>

xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail as a bit map of which cpus are online (default is all).

xend from 4.0 onwards understands maxvcpus as maxvcpus and vcpus as the number which are online (from 0..N-1). The upstream commit (68a94cf528e6 "xm: Add maxvcpus support") claims that if maxvcpus is omitted then the old behaviour (i.e. obeying vcpu_avail) is retained, but AFAICT it was not, in this case vcpu==maxcpus==online cpus. This is good for us because handling anything else would be fiddly.

This patch changes parsing of the virDomainDef maxvcpus and vcpus entries to use the corresponding 'maxvcpus' and 'vcpus' settings from xm and xl config. It also drops use of the old Xen 3.x 'vcpu_avail' setting.

The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since maxvcpus is simply a count, not a bit mask), which is particularly crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are expected to support vcpu placement, and therefore only the boot vcpu's info lives in the shared info page).

Existing tests adjusted accordingly, and new tests added for the 'maxvcpus' setting.

Quoted 6 lines
Quoted 1 line

(as far as "domxml-from-native xen-xl" goes, I seem to have another issue actually starting a domain on ARM, which I'll investigate...)

Turned out to be a mismatch between my build-time and run-time libxl versions, fixed by a clean rebuild. So that's a full Tested-by.

I noticed that the newer cmdline= (inplace of root=+extra= etc) wasn't supported. I'll knock something up.

Ian.

#3 lore raw
In reply to a message not in the archive
Quoted 42 lines · Jim Fehlig

From: Ian Campbell <[email protected]>

xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail as a bit map of which cpus are online (default is all).

xend from 4.0 onwards understands maxvcpus as maxvcpus and vcpus as the number which are online (from 0..N-1). The upstream commit (68a94cf528e6 "xm: Add maxvcpus support") claims that if maxvcpus is omitted then the old behaviour (i.e. obeying vcpu_avail) is retained, but AFAICT it was not, in this case vcpu==maxcpus==online cpus. This is good for us because handling anything else would be fiddly.

This patch changes parsing of the virDomainDef maxvcpus and vcpus entries to use the corresponding 'maxvcpus' and 'vcpus' settings from xm and xl config. It also drops use of the old Xen 3.x 'vcpu_avail' setting.

The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since maxvcpus is simply a count, not a bit mask), which is particularly crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are expected to support vcpu placement, and therefore only the boot vcpu's info lives in the shared info page).

Existing tests adjusted accordingly, and new tests added for the 'maxvcpus' setting.

---

This is a respin of Ian's patch [1] to support parsing/formatting of the 'maxvcpus' xm and xl config setting. It goes a bit further and removes the old Xen 3.x 'vcpu_avail' setting and lifts the maxvcpus limit of MAX_VIRT_CPUS entirely.

The patch is based on my recent series [2] removing xend config version from the codebase.

[1] https://www.redhat.com/archives/libvir-list/2015-November/msg01155.html
[2] https://www.redhat.com/archives/libvir-list/2015-December/msg00616.html

Quoted 9 lines
 src/xenconfig/xen_common.c                    | 25 +++++++++++----------
 tests/xlconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
 tests/xlconfigdata/test-paravirt-maxvcpus.xml | 28 ++++++++++++++++++++++++
 tests/xlconfigtest.c                          |  1 +
 tests/xmconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
 tests/xmconfigdata/test-paravirt-maxvcpus.xml | 31 +++++++++++++++++++++++++++
 tests/xmconfigdata/test-paravirt-vcpu.cfg     |  4 ++--
 tests/xmconfigtest.c                          |  1 +
 8 files changed, 101 insertions(+), 15 deletions(-)

ACK

Michal

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 52 lines · Michal Privoznik
Quoted 42 lines · Jim Fehlig

From: Ian Campbell <[email protected]>

xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail as a bit map of which cpus are online (default is all).

xend from 4.0 onwards understands maxvcpus as maxvcpus and vcpus as the number which are online (from 0..N-1). The upstream commit (68a94cf528e6 "xm: Add maxvcpus support") claims that if maxvcpus is omitted then the old behaviour (i.e. obeying vcpu_avail) is retained, but AFAICT it was not, in this case vcpu==maxcpus==online cpus. This is good for us because handling anything else would be fiddly.

This patch changes parsing of the virDomainDef maxvcpus and vcpus entries to use the corresponding 'maxvcpus' and 'vcpus' settings from xm and xl config. It also drops use of the old Xen 3.x 'vcpu_avail' setting.

The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since maxvcpus is simply a count, not a bit mask), which is particularly crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are expected to support vcpu placement, and therefore only the boot vcpu's info lives in the shared info page).

Existing tests adjusted accordingly, and new tests added for the 'maxvcpus' setting.

---

This is a respin of Ian's patch [1] to support parsing/formatting of the 'maxvcpus' xm and xl config setting. It goes a bit further and removes the old Xen 3.x 'vcpu_avail' setting and lifts the maxvcpus limit of MAX_VIRT_CPUS entirely.

The patch is based on my recent series [2] removing xend config version from the codebase.

[1] https://www.redhat.com/archives/libvir-list/2015-November/msg01155.html
[2] https://www.redhat.com/archives/libvir-list/2015-December/msg00616.html

Quoted 9 lines
 src/xenconfig/xen_common.c                    | 25 +++++++++++----------
 tests/xlconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
 tests/xlconfigdata/test-paravirt-maxvcpus.xml | 28 ++++++++++++++++++++++++
 tests/xlconfigtest.c                          |  1 +
 tests/xmconfigdata/test-paravirt-maxvcpus.cfg | 13 +++++++++++
 tests/xmconfigdata/test-paravirt-maxvcpus.xml | 31 +++++++++++++++++++++++++++
 tests/xmconfigdata/test-paravirt-vcpu.cfg     |  4 ++--
 tests/xmconfigtest.c                          |  1 +
 8 files changed, 101 insertions(+), 15 deletions(-)
Quoted 1 line

ACK

Thanks, pushed now.

Regards,
Jim