mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen: add real time scheduler rtds
This scheduler follows the Preemptive Global Earliest Deadline First (EDF) theory in real-time field. At any scheduling point, the VCPU with earlier deadline has higher priority. The scheduler always picks the highest priority VCPU to run on a feasible PCPU. A PCPU is feasible if the VCPU can run on this PCPU and (the PCPU is idle or has a lower-priority VCPU running on it.) Each VCPU has a dedicated period and budget. The deadline of a VCPU is at the end of each period; A VCPU has its budget replenished at the beginning of each period; While scheduled, a VCPU burns its budget. The VCPU needs to finish its budget before its deadline in each period; The VCPU discards its unused budget at the end of each period. If a VCPU runs out of budget in a period, it has to wait until next period. Each VCPU is implemented as a deferable 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. Queue scheme: A global runqueue and a global depletedq for each CPU pool. The runqueue holds all runnable VCPUs with budget and sorted by deadline; The depletedq holds all VCPUs without budget and unsorted. Note: cpumask and cpupool is supported. This is an experimental scheduler. Signed-off-by: Meng Xu <mengxu@cis.upenn.edu> Signed-off-by: Sisu Xi <xisisu@gmail.com> Acked-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com> Tested-by: Dario Faggioli <dario.faggioli@citrix.com> Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com> [ ijc -- use PRI_stime to print delta in burn_budget, to fix build on 32-bit (i.e. arm32) ]
This commit is contained in:
1 parent
e9d6c685b1
commit
8726c05577
6 files changed
+1109
No files matched your search
@@ -26,6 +26,7 @@ obj-y += sched_credit.o
|
||||
obj-y += sched_credit2.o
|
||||
obj-y += sched_sedf.o
|
||||
obj-y += sched_arinc653.o
|
||||
obj-y += sched_rt.o
|
||||
obj-y += schedule.o
|
||||
obj-y += shutdown.o
|
||||
obj-y += softirq.o
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -69,6 +69,7 @@ static const struct scheduler *schedulers[] = {
|
||||
&sched_credit_def,
|
||||
&sched_credit2_def,
|
||||
&sched_arinc653_def,
|
||||
&sched_rtds_def,
|
||||
};
|
||||
|
||||
static struct scheduler __read_mostly ops;
|
||||
|
||||
@@ -347,6 +347,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_max_vcpus_t);
|
||||
#define XEN_SCHEDULER_CREDIT 5
|
||||
#define XEN_SCHEDULER_CREDIT2 6
|
||||
#define XEN_SCHEDULER_ARINC653 7
|
||||
#define XEN_SCHEDULER_RTDS 8
|
||||
|
||||
/* Set or get info? */
|
||||
#define XEN_DOMCTL_SCHEDOP_putinfo 0
|
||||
#define XEN_DOMCTL_SCHEDOP_getinfo 1
|
||||
@@ -368,6 +370,10 @@ struct xen_domctl_scheduler_op {
|
||||
struct xen_domctl_sched_credit2 {
|
||||
uint16_t weight;
|
||||
} credit2;
|
||||
struct xen_domctl_sched_rtds {
|
||||
uint32_t period;
|
||||
uint32_t budget;
|
||||
} rtds;
|
||||
} u;
|
||||
};
|
||||
typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;
|
||||
|
||||
@@ -77,6 +77,7 @@
|
||||
#define TRC_SCHED_CSCHED2 1
|
||||
#define TRC_SCHED_SEDF 2
|
||||
#define TRC_SCHED_ARINC653 3
|
||||
#define TRC_SCHED_RTDS 4
|
||||
|
||||
/* Per-scheduler tracing */
|
||||
#define TRC_SCHED_CLASS_EVT(_c, _e) \
|
||||
|
||||
@@ -169,6 +169,7 @@ extern const struct scheduler sched_sedf_def;
|
||||
extern const struct scheduler sched_credit_def;
|
||||
extern const struct scheduler sched_credit2_def;
|
||||
extern const struct scheduler sched_arinc653_def;
|
||||
extern const struct scheduler sched_rtds_def;
|
||||
|
||||
|
||||
struct cpupool
|
||||
|
||||