[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] xen: Have schedulers revise initial placement



On 18/07/2016 19:55, Dario Faggioli wrote:
> 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).

Right - this looks easy to fix.  Use a per-pcpu single linked list,
which can be mutated safely with cmpxchg() rather than locks, have
vcpu_wake() add v to the linked list, and schedule itself a
SCHEDULE_SOFTIRQ, (possibly a new SCHEDULE_WAKE_SOFTIRQ with higher
priority than SCHEDULE_SOFTIRQ).

Then in the schedule softirq can take the vcpu schedule lock without
disabling interrupts and run the internals of what is currently
vcpu_wake().  The current content of vcpu_wake() very large for what is
typically executed from interrupt context.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.