diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 49a99c0a73..623a325ceb 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -3555,6 +3555,13 @@ csched2_schedule( __set_bit(__CSFLAG_scheduled, &snext->flags); } + /* Clear the idle mask if necessary */ + if ( cpumask_test_cpu(cpu, &rqd->idle) ) + { + __cpumask_clear_cpu(cpu, &rqd->idle); + smt_idle_mask_clear(cpu, &rqd->smt_idle); + } + /* * The reset condition is "has a scheduler epoch come to an end?". * The way this is enforced is checking whether the vcpu at the top @@ -3575,13 +3582,6 @@ csched2_schedule( balance_load(ops, cpu, now); } - /* Clear the idle mask if necessary */ - if ( cpumask_test_cpu(cpu, &rqd->idle) ) - { - __cpumask_clear_cpu(cpu, &rqd->idle); - smt_idle_mask_clear(cpu, &rqd->smt_idle); - } - snext->start_time = now; snext->tickled_cpu = -1;