Whether or not there's pending tasklet work to do, it's
something we know from the tasklet_work_scheduled parameter.
Deal with that as soon as possible, like all other schedulers
do.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
SCHED_STAT_CRANK(schedule);
NULL_VCPU_CHECK(current);
- ret.task = per_cpu(npc, cpu).vcpu;
+ if ( tasklet_work_scheduled )
+ ret.task = idle_vcpu[cpu];
+ else
+ ret.task = per_cpu(npc, cpu).vcpu;
ret.migrated = 0;
ret.time = -1;
spin_unlock(&prv->waitq_lock);
}
- if ( unlikely(tasklet_work_scheduled ||
- ret.task == NULL ||
- !vcpu_runnable(ret.task)) )
+ if ( unlikely(ret.task == NULL || !vcpu_runnable(ret.task)) )
ret.task = idle_vcpu[cpu];
NULL_VCPU_CHECK(ret.task);