[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 for Xen 4.6 0/4] Enabling XL to set per-VCPU parameters of a domain for RTDS scheduler



[Goal]
The current xl sched-rtds tool can only set the VCPUs of a domain to
the same parameter
although the scheduler supports VCPUs with different parameters. This
patchset is to
enable xl sched-rtds tool to configure the VCPUs of a domain with
different parameters.

This per-VCPU settings can be used in many scenarios. For example,
based on Dario's statement in our pervious
discussion(http://lists.xen.org/archives/html/xen-devel/2014-09/msg00423.html),
if there are two real-time applications, which have different timing
requirements, running in a multi-VCPU guest domain, it is beneficial
to pin these two applications to two seperate VCPUs with different
scheduling parameters.

What this patchset includes is a wanted and planned feature for RTDS
scheudler(http://wiki.xenproject.org/wiki/RTDS-Based-Scheduler) in Xen
4.6. The interface design of the xl sched-rtds tool is based on Meng's
previous discussion with Dario, George and
Wei(http://lists.xen.org/archives/html/xen-devel/2015-02/msg02606.html).
Basically, there are two main changes:

1) in xl, we create an array that records all VCPUs whose parameters
are about to change.

2) in libxl, we receive the array and call different xc functions to handle it.

3) in xen and libxc, we use
XEN_DOMCTL_SCHEDOP_getvcpuinfo/putvcpuinfo(introduced by this
patchset) as the hypercall for per-VCPU operations(get/set method).


[Usage]
With this patchset in use, xl sched-rtds tool can:

1) show the budget and period of each VCPU of each domain, by using
"xl sched-rtds" command. An example would be like:

# xl sched-rtds
Cpupool Pool-0: sched=RTDS
Name                                ID VCPU    Period    Budget
Domain-0                             0    0     10000      4000
vm1                                  1    0      1000       500
vm1                                  1    1      2000      1000
vm2                                  2    0      4000      4000
vm2                                  2    1     10000      4000

For compatibility reason, our toolstack still supports showing the
domain-wise budget and period, by using "xl sched-rtds -o" command.
The output would be like:

# xl sched-rtds -o
Cpupool Pool-0: sched=RTDS
Name                                ID    Period    Budget
Domain-0                             0     10000      4000
vm1                                  1      1000       500
vm2                                  2      4000      4000

This command should only be used when all vcpus of a domain have the
same parameters, otherwise the output
is pointless. The period and budget shown in the output are equal to
the parameters of the first
VCPU of each domain.


2) show the budget and period of each VCPU of a specific domain, by using,
e.g., "xl sched-rtds -d vm1" command. The output would be like:

# xl sched-rtds -d vm1
Name                                ID VCPU    Period    Budget
vm1                                  1    0      1000       500
vm1                                  1    1      2000      1000

To show the domain-wise budget and period, please use, e.g.,"xl
sched-rtds -d vm1 -o" command. The output
would be:

# xl sched-rtds -d vm1 -o
Name                                ID    Period    Budget
vm1                                  1      1000       500

Again, please use this command when all VCPUs of a domain have the
same parameters.

3) set the budget and period of each VCPU of a specific domain, by using,
e.g., "xl sched-rtds -d vm1 -v 0 -p 100 -b 50" command (where "-v 0" specifies
the VCPU with ID=0). The parameters would be like:

# xl sched-rtds -d vm1
Name                                ID VCPU    Period    Budget
vm1                                  1    0       100        50
vm1                                  1    1      2000      1000


Users can also set the budget and period of multiple VCPUs of a specific domain
with only one command, e.g., "xl sched-rtds -d vm1 -v 0 -p 100 -b 50
-v 1 -p 300 -b 150".
The parameters would be like:

# xl sched-rtds -d vm1
Name                                ID VCPU    Period    Budget
vm1                                  1    0       200       100
vm1                                  1    1       300       150

4) Users can still set the per-domain parameters (previous xl rtds
tool already supported this).
e.g., "xl sched-rtds -d vm1 -p 500 -b 250". The parameters would be like:

# xl sched-rtds -d vm1
Name                                ID VCPU    Period    Budget
vm1                                  1    0       500       250
vm1                                  1    1       500       250


Chong Li (4):
  xen: enabling XL to set per-VCPU parameters of a domain for RTDS
    scheduler
  libxc: enabling XL to set per-VCPU parameters of a domain for RTDS
    scheduler
  libxl: enabling XL to set per-VCPU parameters of a domain for RTDS
    scheduler
  xl: enabling XL to set per-VCPU parameters of a domain for RTDS
    scheduler

 tools/libxc/include/xenctrl.h |   9 ++
 tools/libxc/xc_rt.c           |  53 +++++++++
 tools/libxl/libxl.c           | 189 ++++++++++++++++++++++++++----
 tools/libxl/libxl.h           |  19 +++
 tools/libxl/libxl_types.idl   |  11 ++
 tools/libxl/xl_cmdimpl.c      | 261 +++++++++++++++++++++++++++++++++++++-----
 xen/common/domctl.c           |   5 +
 xen/common/sched_rt.c         |  71 +++++++++++-
 xen/common/schedule.c         |  24 ++++
 xen/include/public/domctl.h   |  29 +++++
 xen/include/xen/sched-if.h    |   2 +
 xen/include/xen/sched.h       |   1 +
 12 files changed, 619 insertions(+), 55 deletions(-)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.