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

Re: [Xen-devel] [PATCH] sched: fix race between sched_move_domain() and vcpu_wake()



>>> On 11.10.13 at 13:49, Dario Faggioli <dario.faggioli@xxxxxxxxxx> wrote:
> On ven, 2013-10-11 at 12:32 +0100, George Dunlap wrote:
>> On 11/10/13 12:15, Dario Faggioli wrote:
>> > On ven, 2013-10-11 at 11:32 +0100, George Dunlap wrote:
> 
>> >> But I think this patch is still not quite right: both v->processor and
>> >> per_cpu(schedule_data, ...).schedule_lock may change under your feet; so
>> >> you always need to do the lock in a loop, checking to make sure that you
>> >> *still* have the right lock after you have actually grabbed it.
>> >>
>> > Which, if I'm not mistaken, we sort of get for free it we go Jan's way,
>> > don't we?
>> 
>> You mean, we could just call vcpu_schedule_lock..() instead of writing a 
>> bespoke loop code?  Sure, that's definitely an advantage.
>> 
> Yes, provided we go Jan's way and have it return the lock.
> 
> That way, we'll have vcpu_schedule_lock() responsible for both finding
> the proper lock, and doing it in the right way (with the loop, as you're
> suggesting above), and returning it to the caller.
> 
> That would mean result in code that is both correct and looks better (no
> per_cpu().schedule_lock in the caller), so it's a win win. :-)

So right now I have that change on top of David's. As David's
alone is an improvement (even if still leaving a hole as you
validly pointed out), I'd think we should commit it as is and then
discuss the details of my additional change (in particular the
question of whether to keep [vp]cpu_schedule_unlock...(),
which I for now the patch is dropping).

Jan


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


 


Rackspace

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