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

[Xen-devel] [PATCH 0/1] Improved RTDS scheduler

Current RTDS scheduler is time driven and is called every 1ms. During each 
scheduler call, the repl_update() scans both runq and depeletedq, which might 
not be necessary every 1ms.

Since each vcpu is implemented as a deferable server, budget is preserved 
during its period and refilled in the next. It is not necessary to check every 
1ms as the current design does. The replenishment is needed at the nearest next 
period(nearest current_deadline) of all runnable vcpus.

This improved design tries to reduce scheduler invocation by using an event 
driven approach;rt_schedule() will return a value when the scheduler needs to 
be called next time. In addition, the sched_rt will have one dedicated timer to 
handle replenishment when necessary. In other words, the budget replenishment 
and scheduler decision(rt_schedule) are separated.

Based on previous decision between Dario, Dagaen and Meng, the improved design 
can be implemented/modified as follows:

rt_schedule(): picks the highest runnable vcpu based on cpu affinity and 
ret.time will be passed to schedule().

rt_vcpu_wake(): when a vcpu is awake, it tickles instead of picking one from 

rt_context_saved(): when context switching is finished, the preempted vcpu will 
be put back into the runq. Picking from runq and tickling are removed.

repl_handler(): a timer handler which is reprogrammed to fire at the nearest 
vcpu deadline to replenish vcpus on depeletedq while keeping the runq sorted. 
When the replenishment is done, each replenished vcpu in the runq should tickle 
a pcpu to see if it needs to preempt any running vcpus.

An extra field to record the last replenishing time will be added.

        snext = runq_pick()

sched_rt.c TIMER_SOFTIRQ
        <for_each_depleted_vcpu(i, i.repl_time < NOW()) {

The transient behavior should be noted. It happens between a vcpu tickles and a 
pcpu actually picks it. As previous discussions, this is unavoidable.

Previous discussions:

Signed-off-by: Tianyang Chen <tiche@xxxxxxxxxxxxxx>
Signed-off-by: Meng Xu <mengxu@xxxxxxxxxxxxx>
Signed-off-by: Dagaen Golomb <dgolomb@xxxxxxxxxxxxxx>

*** BLURB HERE ***

Tianyang Chen (1):
  Improved RTDS scheduler

 0000-cover-letter.patch            |   16 +++
 0001-Improved-RTDS-scheduler.patch |  280 ++++++++++++++++++++++++++++++++++++
 bak                                |   62 ++++++++
 xen/common/sched_rt.c              |  159 +++++++++++---------
 4 files changed, 453 insertions(+), 64 deletions(-)
 create mode 100644 0000-cover-letter.patch
 create mode 100644 0001-Improved-RTDS-scheduler.patch
 create mode 100644 bak


Xen-devel mailing list



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