WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Andre Przywara <andre.przywara@xxxxxxx>, Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Avoid race when moving cpu between cpupools
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=lxz0p54tGiyI8genPHUq2titgGzlMcInaL4FYe/OJEA=; b=T01TrgjYl7GszsWqHJoiBuSIlnFubkRQlHrg+v36kERsrCIJGs98cSH3psYw6U7ERV 0wsA0pjiShouIkZ2SQQULyw7SsD8tgQy+sdX3+SarXrYzHHMzWDoykutTJyeo4M9OVdb VInW8AwCV8/oQ6lqLGHg5PW3yRqn00uGKisPI=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D67BBDA.5070603@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvU+V/WlWyg1DRFVkOwBXTkkj/QKQ==
Thread-topic: [Xen-devel] [PATCH] Avoid race when moving cpu between cpupools
User-agent: Microsoft-Entourage/12.28.0.101117
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