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

Re: [Xen-devel] [PATCH] Avoid race when moving cpu between cpupools


  • To: Andre Przywara <andre.przywara@xxxxxxx>, Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Fri, 25 Feb 2011 14:36:23 +0000
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Diestelhorst, Stephan" <Stephan.Diestelhorst@xxxxxxx>
  • Delivery-date: Fri, 25 Feb 2011 06:37:19 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=gHXFtDiJW3Pso5V8GipRhXnZPHlwhslJkUXBb8zwzTzJQA9GhbMrnlqgIZ/Az6s6dO 2YkSxePHiEVjlBD8azc+Ie+W2gBq6zWmx+OqOVD3pC4g33fjbi+yuEAygN7hzU0mo6An eo6PNtAdAzehLqB+t1FmZ3Uw7RJEq+ks+LZSg=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcvU+V/WlWyg1DRFVkOwBXTkkj/QKQ==
  • Thread-topic: [Xen-devel] [PATCH] Avoid race when moving cpu between cpupools

On 25/02/2011 14:25, "Andre Przywara" <andre.przywara@xxxxxxx> wrote:

> can you rule out that this code will be triggered on two CPUs trying to
> switch to each other? As Stephan pointed out: the code looks like as
> this could trigger a possible dead-lock condition, where:
> 1) CPU A grabs lock (a) while CPU B grabs lock (b)
> 2) CPU A tries to grab (b) and CPU B tries to grab (a)
> 3) both fail and loop to 1)
> A possible fix would be to introduce some ordering for the locks (just
> the pointer address) and let the "bigger" pointer yield to the "smaller"
> one. I am not sure if this is really necessary, but I now see strange
> hangs after running the script for a while (30min to 1hr).
> Sometimes Dom0 hangs for a while, loosing interrupts (sda or eth0) or
> getting spurious ones, on two occasions the machine totally locked up.

In other places in Xen where we take a pair of locks with no other implicit
ordering, we enforce an ordering based lock addresses. See
common/timer.c:migrate_timer() for example. I'm sure there must be at least
one example of this in the schedulign code already, with vcpus migrating
between cpus and needing both runqueue locks.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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