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

Re: [Xen-devel] [PATCH v5][RFC]xen: sched: convert RTDS from time to event driven model



Hi Tianyang,

Thanks for the patch! Great work and really quick action! :-)
I will just comment on something I quickly find out and would look forwarding to Dario's comment.

On Mon, Feb 8, 2016 at 11:33 PM, Tianyang Chen <tiche@xxxxxxxxxxxxxx> wrote:
> Changes since v4:
> Â Â removed unnecessary replenishment queue checks in vcpu_wake()
> Â Â extended replq_remove() to all cases in vcpu_sleep()
> Â Â used _deadline_queue_insert() helper function for both queues
> Â Â _replq_insert() and _replq_remove() program timer internally
>
> Changes since v3:
> Â Â removed running queue.
> Â Â added repl queue to keep track of repl events.
> Â Â timer is now per scheduler.
> Â Â timer is init on a valid cpu in a cpupool.
>
> Signed-off-by: Tianyang Chen <tiche@xxxxxxxxxxxxxx>
> Signed-off-by: Meng Xu <mengxu@xxxxxxxxxxxxx>
> Signed-off-by: Dagaen Golomb <dgolomb@xxxxxxxxxxxxxx>
> ---
> Âxen/common/sched_rt.c | Â337 ++++++++++++++++++++++++++++++++++++-------------
> Â1 file changed, 251 insertions(+), 86 deletions(-)
>
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index 2e5430f..1f0bb7b 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -16,6 +16,7 @@
> Â#include <xen/delay.h>
> Â#include <xen/event.h>
> Â#include <xen/time.h>
> +#include <xen/timer.h>
> Â#include <xen/perfc.h>
> Â#include <xen/sched-if.h>
> Â#include <xen/softirq.h>
> @@ -87,7 +88,7 @@
> Â#define RTDS_DEFAULT_BUDGET Â Â (MICROSECS(4000))
>
> Â#define UPDATE_LIMIT_SHIFT Â Â Â10
> -#define MAX_SCHEDULE Â Â Â Â Â Â(MILLISECS(1))
> +
> Â/*
> Â * Flags
> Â */
> @@ -142,6 +143,12 @@ static cpumask_var_t *_cpumask_scratch;
> Â */
> Âstatic unsigned int nr_rt_ops;
>
> +/* handler for the replenishment timer */
> +static void repl_handler(void *data);
> +
> +/* checks if a timer is active or not */
> +bool_t active_timer(struct timer* t);
> +
> Â/*
> Â * Systme-wide private data, include global RunQueue/DepletedQ
> Â * Global lock is referenced by schedule_data.schedule_lock from all
> @@ -152,7 +159,9 @@ struct rt_private {
> Â Â Âstruct list_head sdom; Â Â Â/* list of availalbe domains, used for dump */
> Â Â Âstruct list_head runq; Â Â Â/* ordered list of runnable vcpus */
> Â Â Âstruct list_head depletedq; /* unordered list of depleted vcpus */
> + Â Âstruct list_head replq; Â Â /* ordered list of vcpus that need replenishment */
> Â Â Âcpumask_t tickled; Â Â Â Â Â/* cpus been tickled */
> + Â Âstruct timer *repl_timer; Â /* replenishment timer */
> Â};
>
> Â/*
> @@ -160,6 +169,7 @@ struct rt_private {
> Â */
> Âstruct rt_vcpu {
> Â Â Âstruct list_head q_elem; Â Â/* on the runq/depletedq list */
> + Â Âstruct list_head replq_elem;/* on the repl event list */
>
> Â Â Â/* Up-pointers */
> Â Â Âstruct rt_dom *sdom;
> @@ -213,8 +223,14 @@ static inline struct list_head *rt_depletedq(const struct scheduler *ops)
> Â Â Âreturn &rt_priv(ops)->depletedq;
> Â}
>
> +static inline struct list_head *rt_replq(const struct scheduler *ops)
> +{
> + Â Âreturn &rt_priv(ops)->replq;
> +}
> +
> Â/*
> - * Queue helper functions for runq and depletedq
> + * Queue helper functions for runq, depletedq
> + * and replenishment event queue
> Â */
> Âstatic int
> Â__vcpu_on_q(const struct rt_vcpu *svc)
> @@ -228,6 +244,18 @@ __q_elem(struct list_head *elem)
> Â Â Âreturn list_entry(elem, struct rt_vcpu, q_elem);
> Â}
>
> +static struct rt_vcpu *
> +__replq_elem(struct list_head *elem)
> +{
> + Â Âreturn list_entry(elem, struct rt_vcpu, replq_elem);
> +}
> +
> +static int
> +__vcpu_on_replq(const struct rt_vcpu *svc)
> +{
> + Â return !list_empty(&svc->replq_elem);
> +}
> +
> Â/*
> Â * Debug related code, dump vcpu/cpu information
> Â */
> @@ -288,7 +316,7 @@ rt_dump_pcpu(const struct scheduler *ops, int cpu)
> Âstatic void
> Ârt_dump(const struct scheduler *ops)
> Â{
> - Â Âstruct list_head *runq, *depletedq, *iter;
> + Â Âstruct list_head *runq, *depletedq, *replq, *iter;
> Â Â Âstruct rt_private *prv = rt_priv(ops);
> Â Â Âstruct rt_vcpu *svc;
> Â Â Âstruct rt_dom *sdom;
> @@ -301,6 +329,7 @@ rt_dump(const struct scheduler *ops)
>
> Â Â Ârunq = rt_runq(ops);
> Â Â Âdepletedq = rt_depletedq(ops);
> + Â Âreplq = rt_replq(ops);
>
> Â Â Âprintk("Global RunQueue info:\n");
> Â Â Âlist_for_each( iter, runq )
> @@ -316,6 +345,13 @@ rt_dump(const struct scheduler *ops)
> Â Â Â Â Ârt_dump_vcpu(ops, svc);
> Â Â Â}
>
> + Â Âprintk("Global Replenishment Event info:\n");
> + Â Âlist_for_each( iter, replq )
> + Â Â{
> + Â Â Â Âsvc = __replq_elem(iter);
> + Â Â Â Ârt_dump_vcpu(ops, svc);
> + Â Â}
> +
> Â Â Âprintk("Domain info:\n");
> Â Â Âlist_for_each( iter, &prv->sdom )
> Â Â Â{
> @@ -388,6 +424,66 @@ __q_remove(struct rt_vcpu *svc)
> Â}
>
> Â/*
> + * Removing a vcpu from the replenishment queue could
> + * re-program the timer for the next replenishment event
> + * if the timer is currently active
> + */
> +static inline void
> +__replq_remove(const struct scheduler *ops, struct rt_vcpu *svc)
> +{
> + Â Âstruct rt_private *prv = rt_priv(ops);
> + Â Âstruct list_head *replq = rt_replq(ops);
> + Â Âstruct timer* repl_timer = prv->repl_timer;
> +
> + Â Âif ( __vcpu_on_replq(svc) )
> + Â Â{
> + Â Â Â Â/*
> + Â Â Â Â * disarm the timer if removing the first replenishment event
> + Â Â Â Â * which is going to happen next
> + Â Â Â Â */
> + Â Â Â Âif( active_timer(repl_timer) )
> + Â Â Â Â{
> + Â Â Â Â Â Âstruct rt_vcpu *next_repl = __replq_elem(replq->next);
> +
> + Â Â Â Â Â Âif( next_repl->cur_deadline == svc->cur_deadline )
> + Â Â Â Â Â Â Â Ârepl_timer->expires = 0;
> +
> + Â Â Â Â Â Âlist_del_init(&svc->replq_elem);
> +
> + Â Â Â Â Â Â/* re-arm the timer for the next replenishment event */
> + Â Â Â Â Â Âif( !list_empty(replq) )
> + Â Â Â Â Â Â{
> + Â Â Â Â Â Â Â Âstruct rt_vcpu *svc_next = __replq_elem(replq->next);
> + Â Â Â Â Â Â Â Âset_timer(repl_timer, svc_next->cur_deadline);
> + Â Â Â Â Â Â}
> + Â Â Â Â}
> +

This blank line should go away.. It is quite misleading. At very first glance, I thought it is the else for if ( __vcpu_on_replq(svc) );
But after second read, I found it is actually for the if( active_timer(repl_timer) )

> + Â Â Â Âelse
> + Â Â Â Â Â Âlist_del_init(&svc->replq_elem);
> + Â Â}
> +}
> +
> +/*
> + * An utility function that inserts a vcpu to a
> + * queue based on certain order (EDF)
> + */
> +static void
> +_deadline_queue_insert(struct rt_vcpu * (*_get_q_elem)(struct list_head *elem),
> + Â Âstruct rt_vcpu *svc, struct list_head *elem, struct list_head *queue)
> +{
> + Â Âstruct list_head *iter;
> +
> + Â Âlist_for_each(iter, queue)
> + Â Â{
> + Â Â Â Âstruct rt_vcpu * iter_svc = (*_get_q_elem)(iter);
> + Â Â Â Âif ( svc->cur_deadline <= iter_svc->cur_deadline )
> + Â Â Â Â Â Â Â Âbreak;
> + Â Â}
> +
> + Â Âlist_add_tail(elem, iter);
> +}
> +
> +/*
> Â * Insert svc with budget in RunQ according to EDF:
> Â * vcpus with smaller deadlines go first.
> Â * Insert svc without budget in DepletedQ unsorted;
> @@ -397,7 +493,6 @@ __runq_insert(const struct scheduler *ops, struct rt_vcpu *svc)
> Â{
> Â Â Âstruct rt_private *prv = rt_priv(ops);
> Â Â Âstruct list_head *runq = rt_runq(ops);
> - Â Âstruct list_head *iter;
>
> Â Â ÂASSERT( spin_is_locked(&prv->lock) );
>
> @@ -405,22 +500,37 @@ __runq_insert(const struct scheduler *ops, struct rt_vcpu *svc)
>
> Â Â Â/* add svc to runq if svc still has budget */
> Â Â Âif ( svc->cur_budget > 0 )
> - Â Â{
> - Â Â Â Âlist_for_each(iter, runq)
> - Â Â Â Â{
> - Â Â Â Â Â Âstruct rt_vcpu * iter_svc = __q_elem(iter);
> - Â Â Â Â Â Âif ( svc->cur_deadline <= iter_svc->cur_deadline )
> - Â Â Â Â Â Â Â Â Â Âbreak;
> - Â Â Â Â }
> - Â Â Â Âlist_add_tail(&svc->q_elem, iter);
> - Â Â}
> + Â Â Â Â_deadline_queue_insert(&__q_elem, svc, &svc->q_elem, runq);
> Â Â Âelse
> - Â Â{
> Â Â Â Â Âlist_add(&svc->q_elem, &prv->depletedq);
> - Â Â}
> Â}
>
> Â/*
> + * Insert svc into the repl even list:
> + * vcpus that needs to be repl earlier go first.
> + * scheduler private lock serializes this operation
> + * it could re-program the timer if it fires later than
> + * this vcpu's cur_deadline. Also, this is used to program
> + * the timer for the first time.
> + */
> +static void
> +__replq_insert(const struct scheduler *ops, struct rt_vcpu *svc)
> +{
> + Â Âstruct list_head *replq = rt_replq(ops);
> + Â Âstruct rt_private *prv = rt_priv(ops);
> + Â Âstruct timer *repl_timer = prv->repl_timer;
> +
> + Â ÂASSERT( !__vcpu_on_replq(svc) );
> +
> + Â Â_deadline_queue_insert(&__replq_elem, svc, &svc->replq_elem, replq);
> +
> + Â Âif( repl_timer->expires == 0 ||
> + Â Â Â Â( active_timer(repl_timer) && repl_timer->expires > svc->cur_deadline ) )
> + Â Â Â Âset_timer(repl_timer,svc->cur_deadline);
> +}
> +
> +
> +/*
> Â * Init/Free related code
> Â */
> Âstatic int
> @@ -449,11 +559,18 @@ rt_init(struct scheduler *ops)
> Â Â ÂINIT_LIST_HEAD(&prv->sdom);
> Â Â ÂINIT_LIST_HEAD(&prv->runq);
> Â Â ÂINIT_LIST_HEAD(&prv->depletedq);
> + Â ÂINIT_LIST_HEAD(&prv->replq);
>
> Â Â Âcpumask_clear(&prv->tickled);
>
> Â Â Âops->sched_data = prv;
>
> + Â Â/*
> + Â Â * The timer initialization will happen later when
> + Â Â * the first pcpu is added to this pool in alloc_pdata
> + Â Â */
> + Â Âprv->repl_timer = NULL;
> +
> Â Â Âreturn 0;
>
> Â no_mem:
> @@ -473,6 +590,10 @@ rt_deinit(const struct scheduler *ops)
> Â Â Â Â Âxfree(_cpumask_scratch);
> Â Â Â Â Â_cpumask_scratch = NULL;
> Â Â Â}
> +
> + Â Âkill_timer(prv->repl_timer);
> + Â Âxfree(prv->repl_timer);
> +
> Â Â Âxfree(prv);
> Â}
>
> @@ -493,6 +614,17 @@ rt_alloc_pdata(const struct scheduler *ops, int cpu)
> Â Â Âif ( !alloc_cpumask_var(&_cpumask_scratch[cpu]) )
> Â Â Â Â Âreturn NULL;
>
> + Â Âif( prv->repl_timer == NULL )
> + Â Â{
> + Â Â Â Â/* allocate the timer on the first cpu of this pool */
> + Â Â Â Âprv->repl_timer = xzalloc(struct timer);
> +
> + Â Â Â Âif(prv->repl_timer == NULL )
> + Â Â Â Â Â Âreturn NULL;
> +
> + Â Â Â Âinit_timer(prv->repl_timer, repl_handler, (void *)ops, cpu);
> + Â Â}
> +
> Â Â Â/* 1 indicates alloc. succeed in schedule.c */
> Â Â Âreturn (void *)1;
> Â}
> @@ -586,6 +718,7 @@ rt_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> Â Â Â Â Âreturn NULL;
>
> Â Â ÂINIT_LIST_HEAD(&svc->q_elem);
> + Â ÂINIT_LIST_HEAD(&svc->replq_elem);
> Â Â Âsvc->flags = 0U;
> Â Â Âsvc->sdom = dd;
> Â Â Âsvc->vcpu = vc;
> @@ -609,7 +742,8 @@ rt_free_vdata(const struct scheduler *ops, void *priv)
> Â}
>
> Â/*
> - * This function is called in sched_move_domain() in schedule.c
> + * It is called in sched_move_domain() and sched_init_vcpu
> + * in schedule.c
> Â * When move a domain to a new cpupool.
> Â * It inserts vcpus of moving domain to the scheduler's RunQ in
> Â * dest. cpupool.
> @@ -651,6 +785,10 @@ rt_vcpu_remove(const struct scheduler *ops, struct vcpu *vc)
> Â Â Âlock = vcpu_schedule_lock_irq(vc);
> Â Â Âif ( __vcpu_on_q(svc) )
> Â Â Â Â Â__q_remove(svc);
> +
> + Â Âif( __vcpu_on_replq(svc) )
> + Â Â Â Â__replq_remove(ops,svc);
> +
> Â Â Âvcpu_schedule_unlock_irq(lock, vc);
> Â}
>
> @@ -785,44 +923,6 @@ __runq_pick(const struct scheduler *ops, const cpumask_t *mask)
> Â}
>
> Â/*
> - * Update vcpu's budget and
> - * sort runq by insert the modifed vcpu back to runq
> - * lock is grabbed before calling this function
> - */
> -static void
> -__repl_update(const struct scheduler *ops, s_time_t now)
> -{
> - Â Âstruct list_head *runq = rt_runq(ops);
> - Â Âstruct list_head *depletedq = rt_depletedq(ops);
> - Â Âstruct list_head *iter;
> - Â Âstruct list_head *tmp;
> - Â Âstruct rt_vcpu *svc = NULL;
> -
> - Â Âlist_for_each_safe(iter, tmp, runq)
> - Â Â{
> - Â Â Â Âsvc = __q_elem(iter);
> - Â Â Â Âif ( now < svc->cur_deadline )
> - Â Â Â Â Â Âbreak;
> -
> - Â Â Â Ârt_update_deadline(now, svc);
> - Â Â Â Â/* reinsert the vcpu if its deadline is updated */
> - Â Â Â Â__q_remove(svc);
> - Â Â Â Â__runq_insert(ops, svc);
> - Â Â}
> -
> - Â Âlist_for_each_safe(iter, tmp, depletedq)
> - Â Â{
> - Â Â Â Âsvc = __q_elem(iter);
> - Â Â Â Âif ( now >= svc->cur_deadline )
> - Â Â Â Â{
> - Â Â Â Â Â Ârt_update_deadline(now, svc);
> - Â Â Â Â Â Â__q_remove(svc); /* remove from depleted queue */
> - Â Â Â Â Â Â__runq_insert(ops, svc); /* add to runq */
> - Â Â Â Â}
> - Â Â}
> -}
> -
> -/*
> Â * schedule function for rt scheduler.
> Â * The lock is already grabbed in schedule.c, no need to lock here
> Â */
> @@ -841,7 +941,6 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
> Â Â Â/* burn_budget would return for IDLE VCPU */
> Â Â Âburn_budget(ops, scurr, now);
>
> - Â Â__repl_update(ops, now);
>
> Â Â Âif ( tasklet_work_scheduled )
> Â Â Â{
> @@ -868,6 +967,8 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
> Â Â Â Â Âset_bit(__RTDS_delayed_runq_add, &scurr->flags);
>
> Â Â Âsnext->last_start = now;
> +
> + Â Âret.time = Â-1; /* if an idle vcpu is picked */
> Â Â Âif ( !is_idle_vcpu(snext->vcpu) )
> Â Â Â{
> Â Â Â Â Âif ( snext != scurr )
> @@ -880,9 +981,11 @@ rt_schedule(const struct scheduler *ops, s_time_t now, bool_t tasklet_work_sched
> Â Â Â Â Â Â Âsnext->vcpu->processor = cpu;
> Â Â Â Â Â Â Âret.migrated = 1;
> Â Â Â Â Â}
> +
> + Â Â Â Âret.time = snext->budget; /* invoke the scheduler next time */
> +
> Â Â Â}
>
> - Â Âret.time = MIN(snext->budget, MAX_SCHEDULE); /* sched quantum */
> Â Â Âret.task = snext->vcpu;
>
> Â Â Â/* TRACE */
> @@ -914,7 +1017,7 @@ static void
> Ârt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
> Â{
> Â Â Âstruct rt_vcpu * const svc = rt_vcpu(vc);
> -
> +

Next patch should avoid this. You may have some trailing space in the line.
git has some command to mark the trailing whitespace.
You can have a look at this post: http://stackoverflow.com/questions/5257553/coloring-white-space-in-git-diffs-output

> Â Â ÂBUG_ON( is_idle_vcpu(vc) );
> Â Â ÂSCHED_STAT_CRANK(vcpu_sleep);
>
> @@ -924,6 +1027,9 @@ rt_vcpu_sleep(const struct scheduler *ops, struct vcpu *vc)
> Â Â Â Â Â__q_remove(svc);
> Â Â Âelse if ( svc->flags & RTDS_delayed_runq_add )
> Â Â Â Â Âclear_bit(__RTDS_delayed_runq_add, &svc->flags);
> +
> + Â Âif( __vcpu_on_replq(svc) )
> + Â Â Â Â__replq_remove(ops, svc);
> Â}
>
> Â/*
> @@ -1026,10 +1132,6 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
> Â{
> Â Â Âstruct rt_vcpu * const svc = rt_vcpu(vc);
> Â Â Âs_time_t now = NOW();
> - Â Âstruct rt_private *prv = rt_priv(ops);
> - Â Âstruct rt_vcpu *snext = NULL; /* highest priority on RunQ */
> - Â Âstruct rt_dom *sdom = NULL;
> - Â Âcpumask_t *online;
>
> Â Â ÂBUG_ON( is_idle_vcpu(vc) );
>
> @@ -1051,6 +1153,18 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
> Â Â Âelse
> Â Â Â Â ÂSCHED_STAT_CRANK(vcpu_wake_not_runnable);
>
> + Â Â/* budget repl here is needed before inserting back to runq. If so,
> + Â Â * it should be re-inserted back to the replenishment queue.
> + Â Â */
> + Â Âif ( now >= svc->cur_deadline)
> + Â Â{
> + Â Â Â Ârt_update_deadline(now, svc);
> + Â Â Â Â__replq_remove(ops, svc);
> + Â Â}
> +
> + Â Âif( !__vcpu_on_replq(svc) )
> + Â Â Â Â__replq_insert(ops, svc);
> +
> Â Â Â/* If context hasn't been saved for this vcpu yet, we can't put it on
> Â Â Â * the Runqueue/DepletedQ. Instead, we set a flag so that it will be
> Â Â Â * put on the Runqueue/DepletedQ after the context has been saved.
> @@ -1061,22 +1175,10 @@ rt_vcpu_wake(const struct scheduler *ops, struct vcpu *vc)
> Â Â Â Â Âreturn;
> Â Â Â}
>
> - Â Âif ( now >= svc->cur_deadline)
> - Â Â Â Ârt_update_deadline(now, svc);
> -
> Â Â Â/* insert svc to runq/depletedq because svc is not in queue now */
> Â Â Â__runq_insert(ops, svc);
>
> - Â Â__repl_update(ops, now);
> -
> - Â ÂASSERT(!list_empty(&prv->sdom));
> - Â Âsdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
> - Â Â>> - Â Âsnext = __runq_pick(ops, online); /* pick snext from ALL valid cpus */
> -
> - Â Ârunq_tickle(ops, snext);
> -
> - Â Âreturn;
> + Â Ârunq_tickle(ops, svc);
> Â}
>
> Â/*
> @@ -1087,10 +1189,6 @@ static void
> Ârt_context_saved(const struct scheduler *ops, struct vcpu *vc)
> Â{
> Â Â Âstruct rt_vcpu *svc = rt_vcpu(vc);
> - Â Âstruct rt_vcpu *snext = NULL;
> - Â Âstruct rt_dom *sdom = NULL;
> - Â Âstruct rt_private *prv = rt_priv(ops);
> - Â Âcpumask_t *online;
> Â Â Âspinlock_t *lock = vcpu_schedule_lock_irq(vc);
>
> Â Â Âclear_bit(__RTDS_scheduled, &svc->flags);
> @@ -1102,14 +1200,7 @@ rt_context_saved(const struct scheduler *ops, struct vcpu *vc)
> Â Â Â Â Â likely(vcpu_runnable(vc)) )
> Â Â Â{
> Â Â Â Â Â__runq_insert(ops, svc);
> - Â Â Â Â__repl_update(ops, NOW());
> -
> - Â Â Â ÂASSERT(!list_empty(&prv->sdom));
> - Â Â Â Âsdom = list_entry(prv->sdom.next, struct rt_dom, sdom_elem);
> - Â Â Â Â>> - Â Â Â Âsnext = __runq_pick(ops, online); /* pick snext from ALL cpus */
> -
> - Â Â Â Ârunq_tickle(ops, snext);
> + Â Â Â Ârunq_tickle(ops, svc);
> Â Â Â}
> Âout:
> Â Â Âvcpu_schedule_unlock_irq(lock, vc);
> @@ -1168,6 +1259,80 @@ rt_dom_cntl(
> Â Â Âreturn rc;
> Â}
>
> +/*
> + * The replenishment timer handler picks vcpus
> + * from the replq and does the actual replenishment
> + */
> +static void repl_handler(void *data){
> + Â Âunsigned long flags;
> + Â Âs_time_t now = NOW();
> + Â Âstruct scheduler *ops = data;
> + Â Âstruct rt_private *prv = rt_priv(ops);
> + Â Âstruct list_head *replq = rt_replq(ops);
> + Â Âstruct timer *repl_timer = prv->repl_timer;
> + Â Âstruct list_head *iter, *tmp;
> + Â Âstruct rt_vcpu *svc = NULL;
> +
> + Â Âspin_lock_irqsave(&prv->lock, flags);
> +
> + Â Âstop_timer(repl_timer);
> +
> + Â Âlist_for_each_safe(iter, tmp, replq)
> + Â Â{
> + Â Â Â Âsvc = __replq_elem(iter);
> +
> + Â Â Â Âif ( now >= svc->cur_deadline )
> + Â Â Â Â{
> + Â Â Â Â Â Ârt_update_deadline(now, svc);
> +
> + Â Â Â Â Â Â/*
> + Â Â Â Â Â Â * when the replenishment happens
> + Â Â Â Â Â Â * svc is either on a pcpu or on
> + Â Â Â Â Â Â * runq/depletedq
> + Â Â Â Â Â Â */
> + Â Â Â Â Â Âif( __vcpu_on_q(svc) )
> + Â Â Â Â Â Â{
> + Â Â Â Â Â Â Â Â/* put back to runq */
> + Â Â Â Â Â Â Â Â__q_remove(svc);
> + Â Â Â Â Â Â Â Â__runq_insert(ops, svc);
> + Â Â Â Â Â Â}
> +
> + Â Â Â Â Â Â/*
> + Â Â Â Â Â Â * tickle regardless where it's at
> + Â Â Â Â Â Â * because a running vcpu could have
> + Â Â Â Â Â Â * a later deadline than others after
> + Â Â Â Â Â Â * replenishment
> + Â Â Â Â Â Â */
> + Â Â Â Â Â Ârunq_tickle(ops, svc);
> +
> + Â Â Â Â Â Â/* update replenishment event queue */
> + Â Â Â Â Â Â__replq_remove(ops, svc);
> + Â Â Â Â Â Â__replq_insert(ops, svc);
> + Â Â Â Â}
> +

This white line should be removed...

> + Â Â Â Âelse
> + Â Â Â Â Â Âbreak;
> + Â Â}
> +
> + Â Â/*
> + Â Â * use the vcpu that's on the top
> + Â Â * or else don't program the timer
> + Â Â */
> + Â Âif( !list_empty(replq) )
> + Â Â Â Âset_timer(repl_timer, __replq_elem(replq->next)->cur_deadline);
> +
> + Â Âspin_unlock_irqrestore(&prv->lock, flags);
> +
> +}
> +
> +/* checks if a timer has been stopped or not */
> +bool_t active_timer(struct timer *timer)
> +{
> + Â ÂASSERT(timer->status >= TIMER_STATUS_inactive);
> + Â ÂASSERT(timer->status <= TIMER_STATUS_in_list);
> + Â Âreturn (timer->status >= TIMER_STATUS_in_heap);
> +}
> +
> Âstatic struct rt_private _rt_priv;
>
> Âstatic const struct scheduler sched_rtds_def = {
> --
> 1.7.9.5
>

Thanks and best regards,

Meng

--


-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
http://www.cis.upenn.edu/~mengxu/
_______________________________________________
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®.