xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Meng Xu <mengxu@cis.upenn.edu>
To: xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, xisisu@gmail.com,
	stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com,
	dario.faggioli@citrix.com, ian.jackson@eu.citrix.com,
	xumengpanda@gmail.com, JBeulich@suse.com, chaowang@wustl.edu,
	lichong659@gmail.com, dgolomb@seas.upenn.edu
Subject: Introduce rt real-time scheduler for Xen
Date: Sun, 24 Aug 2014 18:58:41 -0400	[thread overview]
Message-ID: <1408921125-21470-1-git-send-email-mengxu@cis.upenn.edu> (raw)

Hi all,

This serie of patches adds rt real-time scheduler to Xen.

In summary, It supports:
1) Preemptive Global Earliest Deadline First scheduling policy by using a global RunQ for the scheduler;
2) Assign/display each VCPU's parameters of each domain;
3) Supports CPU Pool

Compared with the set of patches in version RFC v2, this set of patch has the following improvement:
    a) added rt scheduler specific TRACE facility for rt scheduler
    b) more efficient RunQ implementation to avoid scanning the whole RunQ when insert a vcpu without budget.
    c) bug fix for cpupool support.

-----------------------------------------------------------------------------------------------------------------------------
TODO:
    a) Burn budget in finer granularity instead of 1ms; [medium]
    b) Use separate timer per vcpu for each vcpu's budget replenishment, instead of scanning the full runqueue every now and then [medium]
    c) Handle time stolen from domU by hypervisor. When it runs on a machine with many sockets and lots of cores, the spin-lock for global RunQ used in rt scheduler could eat up time from domU, which could make domU have less budget than it requires. [not sure about difficulty right now] (Thank Konrad Rzeszutek to point this out in the XenSummit. :-))

Plan:
    We will work on TODO a) and b) and try to finish these two items before September 10th. (We will also tackle the comments raised in the review of this set of patches.)

-----------------------------------------------------------------------------------------------------------------------------
The design of this rt scheduler is as follows:
This rt scheduler follows the Preemptive Global Earliest Deadline First (GEDF) theory in real-time field.
Each VCPU can have a dedicated period and budget. While scheduled, a VCPU burns its budget. Each VCPU has its budget replenished at the beginning of each of its periods; Each VCPU discards its unused budget at the end of each of its periods. If a VCPU runs out of budget in a period, it has to wait until next period.
The mechanism of how to burn a VCPU's budget depends on the server mechanism implemented for each VCPU.
The mechanism of deciding the priority of VCPUs at each scheduling point is based on the Preemptive Global Earliest Deadline First scheduling scheme.

Server mechanism: a VCPU is implemented as a deferrable server.
When a VCPU has a task running on it, its budget is continuously burned;
When a VCPU has no task but with budget left, its budget is preserved.

Priority scheme: Global Earliest Deadline First (EDF).
At any scheduling point, the VCPU with earliest deadline has highest priority.

Queue scheme: A global runqueue for each CPU pool.
The runqueue holds all runnable VCPUs.
VCPUs in the runqueue are divided into two parts: with and without remaining budget.
At each part, VCPUs are sorted based on GEDF priority scheme.

Scheduling quanta: 1 ms.

If you are intersted in the details of the design and evaluation of this rt scheduler, please refer to our paper "Real-Time Multi-Core Virtual Machine Scheduling in Xen" (http://www.cis.upenn.edu/~mengxu/emsoft14/emsoft14.pdf), which will be published in EMSOFT14. This paper has the following details:
    a) Desgin of this scheduler;
    b) Measurement of the implementation overhead, e.g., scheduler overhead, context switch overhead, etc.
    c) Comparison of this rt scheduler and credit scheduler in terms of the real-time performance.
-----------------------------------------------------------------------------------------------------------------------------
One scenario to show the functionality of this rt scheduler is as follows:
//list each vcpu's parameters of each domain in cpu pools using rt scheduler
#xl sched-rt
Cpupool Pool-0: sched=EDF
Name                                ID VCPU Period Budget
Domain-0                             0    0  10000  10000
Domain-0                             0    1  20000  20000
Domain-0                             0    2  30000  30000
Domain-0                             0    3  10000  10000
litmus1                              1    0  10000   4000
litmus1                              1    1  10000   4000

//set the parameters of the vcpu 1 of domain litmus1:
# xl sched-rt -d litmus1 -v 1 -p 20000 -b 10000

//domain litmus1's vcpu 1's parameters are changed, display each VCPU's parameters separately:
# xl sched-rt -d litmus1
Name                                ID VCPU Period Budget
litmus1                              1    0  10000   4000
litmus1                              1    1  20000  10000

// list cpupool information
xl cpupool-list
Name               CPUs   Sched     Active   Domain count
Pool-0              12        rt       y          2

//create a cpupool test
#xl cpupool-cpu-remove Pool-0 11
#xl cpupool-cpu-remove Pool-0 10
#xl cpupool-create name=\"test\" sched=\"credit\"
#xl cpupool-cpu-add test 11
#xl cpupool-cpu-add test 10
#xl cpupool-list
Name               CPUs   Sched     Active   Domain count
Pool-0              10        rt       y          2
test                 2    credit       y          0   

//migrate litmus1 from cpupool Pool-0 to cpupool test.
#xl cpupool-migrate litmus1 test

//now litmus1 is in cpupool test
# xl sched-credit 
Cpupool test: tslice=30ms ratelimit=1000us
Name                                ID Weight  Cap
litmus1                              1    256    0 

-----------------------------------------------------------------------------------------------------------------------------
This set of patches is tested by using the above scenario and running cpu intensive tasks inside each guest domain. We manually check if a domain can have its required resource without being interferenced by other domains; We also manually checked if the scheduling sequence of vcpus follows the Earliest Deadline First scheduling policy.

Any comment, question, and concerns are more than welcome! :-)

Thank you very much!

Best,

Meng

[PATCH v1 1/4] xen: add real time scheduler rt
[PATCH v1 2/4] libxc: add rt scheduler
[PATCH v1 3/4] libxl: add rt scheduler
[PATCH v1 4/4] xl: introduce rt scheduler

---
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania

             reply	other threads:[~2014-08-24 22:58 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-24 22:58 Meng Xu [this message]
2014-08-24 22:58 ` [PATCH v1 1/4] xen: add real time scheduler rt Meng Xu
2014-08-26 14:27   ` Jan Beulich
2014-08-27  2:07     ` Meng Xu
2014-08-27  6:26       ` Jan Beulich
2014-08-27 14:28         ` Meng Xu
2014-08-27 15:04           ` Jan Beulich
2014-08-28 16:06             ` Meng Xu
2014-08-29  9:05               ` Jan Beulich
2014-08-29 19:35                 ` Meng Xu
2014-09-03 14:08                 ` George Dunlap
2014-09-03 14:24                   ` Meng Xu
2014-09-03 14:35                     ` Dario Faggioli
2014-09-03 13:40   ` George Dunlap
2014-09-03 14:11     ` Meng Xu
2014-09-03 14:15       ` George Dunlap
2014-09-03 14:35         ` Meng Xu
2014-09-05  9:46     ` Dario Faggioli
2014-09-03 14:20   ` George Dunlap
2014-09-03 14:45     ` Jan Beulich
2014-09-03 14:59     ` Dario Faggioli
2014-09-03 15:27       ` Meng Xu
2014-09-03 15:46         ` Dario Faggioli
2014-09-03 17:13           ` George Dunlap
2014-09-03 15:13     ` Meng Xu
2014-09-03 16:06       ` George Dunlap
2014-09-03 16:57         ` Dario Faggioli
2014-09-03 17:18           ` George Dunlap
2014-09-04  2:15             ` Meng Xu
2014-09-04 14:27             ` Dario Faggioli
2014-09-04 15:30               ` Meng Xu
2014-09-05  9:36                 ` Dario Faggioli
2014-09-05 15:06                   ` Meng Xu
2014-09-05 15:09                     ` Dario Faggioli
2014-09-04  2:11         ` Meng Xu
2014-09-04 11:00           ` Dario Faggioli
2014-09-04 13:03           ` George Dunlap
2014-09-04 14:00             ` Meng Xu
2014-09-05 17:17   ` Dario Faggioli
2014-09-07  3:56     ` Meng Xu
2014-09-08 10:33       ` Dario Faggioli
2014-09-09 13:43         ` Meng Xu
2014-08-24 22:58 ` [PATCH v1 2/4] libxc: add rt scheduler Meng Xu
2014-09-05 10:34   ` Dario Faggioli
2014-09-05 17:17     ` Meng Xu
2014-09-05 17:50       ` Dario Faggioli
2014-08-24 22:58 ` [PATCH v1 3/4] libxl: " Meng Xu
2014-08-25 13:17   ` Wei Liu
2014-08-25 15:55     ` Meng Xu
2014-08-26  9:51       ` Wei Liu
2014-09-03 15:33   ` George Dunlap
2014-09-03 20:52     ` Meng Xu
2014-09-04 14:27     ` George Dunlap
2014-09-04 14:45       ` Dario Faggioli
2014-09-04 14:47       ` Meng Xu
2014-09-04 14:51         ` George Dunlap
2014-09-04 15:07           ` Meng Xu
2014-09-04 15:44             ` Dario Faggioli
2014-09-04 15:55               ` George Dunlap
2014-09-04 16:12                 ` Meng Xu
2014-09-05  9:19                   ` Dario Faggioli
2014-09-04 15:25         ` Dario Faggioli
2014-09-05 10:21   ` Dario Faggioli
2014-09-05 15:45     ` Meng Xu
2014-09-05 17:41       ` Dario Faggioli
2014-08-24 22:58 ` [PATCH v1 4/4] xl: introduce " Meng Xu
2014-08-25 13:31   ` Wei Liu
2014-08-25 16:12     ` Meng Xu
2014-09-03 15:52   ` George Dunlap
2014-09-03 22:28     ` Meng Xu
2014-09-05  9:40       ` Dario Faggioli
2014-09-05 14:43         ` Meng Xu
  -- strict thread matches above, loose matches on Subject: below --
2014-09-07 19:40 Introduce rt real-time scheduler for Xen Meng Xu
2014-07-29  1:52 Meng Xu
2014-07-11  4:49 Meng Xu
2014-07-11 10:50 ` Wei Liu
2014-07-11 11:06   ` Dario Faggioli
2014-07-11 16:14     ` Meng Xu
2014-07-11 16:19 ` 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=1408921125-21470-1-git-send-email-mengxu@cis.upenn.edu \
    --to=mengxu@cis.upenn.edu \
    --cc=JBeulich@suse.com \
    --cc=chaowang@wustl.edu \
    --cc=dario.faggioli@citrix.com \
    --cc=dgolomb@seas.upenn.edu \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=lichong659@gmail.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@gmail.com \
    --cc=xumengpanda@gmail.com \
    /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).