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] cpupools and locking

To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] cpupools and locking
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Wed, 05 May 2010 07:25:51 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 04 May 2010 22:26:40 -0700
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1273037087; x=1304573087; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; z=Message-ID:=20<4BE1015F.8050901@xxxxxxxxxxxxxx>|Date:=20 Wed,=2005=20May=202010=2007:25:51=20+0200|From:=20Juergen =20Gross=20<juergen.gross@xxxxxxxxxxxxxx>|MIME-Version: =201.0|To:=20George=20Dunlap=20<George.Dunlap@xxxxxxxxxxx om>,=20=0D=0A=20Keir=20Fraser=20<Keir.Fraser@xxxxxxxxxxxx m>|CC:=20xen-devel@xxxxxxxxxxxxxxxxxxx|Subject:=20Re:=20[ Xen-devel]=20cpupools=20and=20locking|References:=20<w2jd e76405a1005041151lded10645z70c2ed600e0728a1@xxxxxxxxxxxxx m>|In-Reply-To:=20<w2jde76405a1005041151lded10645z70c2ed6 00e0728a1@xxxxxxxxxxxxxx>|Content-Transfer-Encoding:=207b it; bh=x0pmI0SLQcWfiynrckhzbV9qCwPmAvIxKH33BcFcprc=; b=JC5rhG9xhgrHfLmaVqgQC9ESg71ZpqGohz8OQvaCChsMjptcaSN/dveW Px5vy/jGQI7WW2ukk5SeDVt8QLU+Sjrw/GosVXZPGh02Edgv5pNlrCKEJ 8sXPY8XYkoq+t0bYawH1AiN9ODRpsMHMkhdNAmTFpcJln25MaWQ86drDl 50eL7+jkcRDecStJ8xcZ5QDmICTlwVbPRhJLWieecnr7qwpnCa6Gdxtvm CQgmeKRzYdGBkX+aeqf+vCnLq4nBM;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=BXfHRvb/6WUEYZpfjIU35dOnfdcJd3F0yIhFsQ2/peu8X08LFeuvG8DJ yKQCN5l+RqDPn8G4uaKNwVr+jsnDV5QgkWK1swBSh/VYFRb4FofYsll04 gyDT/iZPHMHP1hhkvsPkFtM3ZVpgFYEoQJ+HoIhd/OTMjvbXaW1Cl1yzL tdKIZ/Dpjs/9s5scVFqDk+uzEZXhWU6j1lAeeCsbPhVgZ3dwNe7EEwXvj 4hyAYUhvb/GLq7cE8ilw+CBdLtzaR;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <w2jde76405a1005041151lded10645z70c2ed600e0728a1@xxxxxxxxxxxxxx>
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>
Organization: Fujitsu Technology Solutions
References: <w2jde76405a1005041151lded10645z70c2ed600e0728a1@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100411 Iceowl/1.0b1 Icedove/3.0.4
On 05/04/2010 08:51 PM, George Dunlap wrote:
Something seems not quite right about the cpupool locking... in
xen/common/cpupool.c:cpupool_do_domctl(), the cpupool_lock is only
held during the find for several operations.  Doesn't that mean that,
for instance, it's possible for someone to call CPUPOOL_OP_DESTROY,
while someone concurrently calls CPUPOOL_OP_INFO, such that in the
INFO case, the find succeeds, but the structure is shortly thereafter
freed by DESTROY, even though INFO code still has a pointer to it
which may be dereferenced?  I don't see any reference counting... am I
missing something?

cpupool_do_domctl is called always while the domctl lock is being held. Maybe
I should have added a comment to document this assumption.

Keir's patch to move the cpupool commands to the sysctl interface makes a
change of the locking mandatory. I'll setup a patch for this.


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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

<Prev in Thread] Current Thread [Next in Thread>