On Mon, 2016-07-18 at 19:10 +0100, Andrew Cooper wrote: > On 16/07/16 15:12, Dario Faggioli wrote: > > On Fri, 2016-07-15 at 19:07 +0100, Andrew Cooper wrote: > > So you have to always keep IRQ enabled, for all scheduling > > operations, > > which is ok for _almost_ all of them, with the only exception of > > the > > wakeup of a vcpu. > I know that it is all or nothing.  What specific action about waking > a > vcpu requires holding a lock? > > If it is simply re-queueing the vcpu onto the runable queue, there > are a > number of lockless queuing algorithms which can be used. > Yes, it's vcpu_wake() that does vcpu_schedule_lock_irqsave() before, among other things, calling SCHED_OP(wake, v). What the implementation of that hook does, is scheduler dependant. In most of the case, the core of it is, as you say, enqueueing the vcpu, but that may not be all. For instance, something that, all the schedulers, after queueing, do is tickling pCPUs for having them pick up the queued work, and that also requires serialization to be correct and effective (i.e., "just" turning and mandating runqueues to be lockless would not be enough). > ~Andrew -- <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)