interrupts are already disabled when calling the hook
(from schedule_cpu_switch()), so we must use spin_lock()
and spin_unlock().
Add an ASSERT(), so we will notice if this code and its
caller get out of sync with respect to disabling interrupts
(and add one at the same exact occurrence of this pattern
in Credit1 too)
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
* schedule_cpu_switch()). It actually may or may not be the 'right'
* one for this cpu, but that is ok for preventing races.
*/
+ ASSERT(!local_irq_is_enabled());
spin_lock(&prv->lock);
init_pdata(prv, pdata, cpu);
spin_unlock(&prv->lock);
* And owning exactly that one (the lock of the old scheduler of this
* cpu) is what is necessary to prevent races.
*/
- spin_lock_irq(&prv->lock);
+ ASSERT(!local_irq_is_enabled());
+ spin_lock(&prv->lock);
idle_vcpu[cpu]->sched_priv = vdata;
smp_mb();
per_cpu(schedule_data, cpu).schedule_lock = &prv->rqd[rqi].lock;
- spin_unlock_irq(&prv->lock);
+ spin_unlock(&prv->lock);
}
static void