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

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



>>> @@ -115,6 +118,18 @@
>>>   #define RTDS_delayed_runq_add (1<<__RTDS_delayed_runq_add)
>>>
>>>   /*
>>> + * The replenishment timer handler needs to check this bit
>>> + * to know where a replenished vcpu was, when deciding which
>>> + * vcpu should tickle.
>>> + * A replenished vcpu should tickle if it was moved from the
>>> + * depleted queue to the run queue.
>>> + * + Set in burn_budget() if a vcpu has zero budget left.
>>> + * + Cleared and checked in the repenishment handler.
>>
>>
>> It seems you have an extra + here...
>> Need to be removed.
>>
>> My bad, I didn't spot it out in last patch... :-(
>>
>
> You mean before "Cleared"? For __RTDS_scheduled there are '+' before
> 'Cleared', 'Checked', 'Set'.

Yes, those two +, are unnecessary. Isn't it?

>
>>> @@ -840,8 +991,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 )
>>>       {
>>>           trace_var(TRC_RTDS_SCHED_TASKLET, 1, 0,  NULL);
>>> @@ -868,6 +1017,7 @@ 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 +1030,8 @@ 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 */
>>
>>
>> Ah, this is incorrect, although this is easy to fix.
>>
>> The ret.time is the relative time when the *budget enforcement* timer
>> should be invoked.
>> Since snext is not always full budget, it may have already consumed some
>> budget.
>>
>> It should be
>> ret.time = snext->cur_budget
>>
>> Isn't it? :-)
>
> Good catch. This bug kinda ruins the fix for busy waiting.

Right! This just shows why we may need some semi-automated testing
tools to test the logic correctness. ;-)

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®.