On 03/15/2016 11:11 PM, Meng Xu wrote:
+
/*
* Flags
*/
@@ -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'.
@@ -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.
Thanks,
Tianyang
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel