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] Cpu pools discussion

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Cpu pools discussion
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Wed, 29 Jul 2009 10:52:03 +0200
Cc: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>, George Dunlap <dunlapg@xxxxxxxxx>, Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 29 Jul 2009 01:52:31 -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=1248857448; x=1280393448; h=from:sender:reply-to:subject:date:message-id:to:cc: mime-version:content-transfer-encoding:content-id: content-description:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-message-id:in-reply-to: references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; z=From:=20Juergen=20Gross=20<juergen.gross@xxxxxxxxxxxxxx> |Subject:=20Re:=20[Xen-devel]=20Cpu=20pools=20discussion |Date:=20Wed,=2029=20Jul=202009=2010:52:03=20+0200 |Message-ID:=20<4A700DB3.9010700@xxxxxxxxxxxxxx>|To:=20Ke ir=20Fraser=20<keir.fraser@xxxxxxxxxxxxx>|CC:=20Tim=20Dee gan=20<Tim.Deegan@xxxxxxxxxxxxx>,=20=0D=0A=20George=20Dun lap=20<dunlapg@xxxxxxxxx>,=0D=0A=20Zhigang=20Wang=20<zhig ang.x.wang@xxxxxxxxxx>,=20=0D=0A=20"xen-devel@xxxxxxxxxxx urce.com"=20<xen-devel@xxxxxxxxxxxxxxxxxxx>|MIME-Version: =201.0|Content-Transfer-Encoding:=207bit|In-Reply-To:=20< C695BB2B.10DB6%keir.fraser@xxxxxxxxxxxxx>|References:=20< C695BB2B.10DB6%keir.fraser@xxxxxxxxxxxxx>; bh=ily/x1DWDnjv2iuZ8vAKgwlM/WioXBtfPkJwaHQkPEA=; b=Uu/OFeAftZCfWDTefgi6xdUkcpsw3v7XV/uIWXmtEC7dRILfRZP2Be74 IqD0Qg6mNGfvGCOmHrZFMaIZYanYPDcOd9QuV4F025HBQfZiEeBD+wndl fBMJVP1uT7kpppAzqFruWIWyM1zjMDvOHx1anIYUjxiGsEBStm4fk+UwI wuO1hVNbjNEsoBRMgCQMwZrWdJgdJgK9aF4s3Nqd+HVDrIsCc2ieUwRg3 dqAuOBfcQIBTon0EhEevnOopwXPwQ;
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:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=T2h67kvgARfaSLaLK9Dhmjltq58PZtKfKW1PiS+md29rmDlGT+dvqLvD ftJBpj7bu8pEti0IF6zqlo5iI6YHmwAFrfH3T6/Cv86JS1eEYg2ajzfje 46sMTVlSrIHS8DFELwvb70xekOE3/Ow/VoQG2J0Hfj09juj0HnrDv6t// NQRIX5jdrzTCMwGtxH1wBpCBvt53+frsltoz/T9rvbG9yD/uv34mLHuj0 petGd89xl98bxgYgSzrPdZIUys6G0;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C695BB2B.10DB6%keir.fraser@xxxxxxxxxxxxx>
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: <C695BB2B.10DB6%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)
Keir Fraser wrote:
> On 29/07/2009 07:14, "Juergen Gross" <juergen.gross@xxxxxxxxxxxxxx> wrote:
> 
>>> Just pulled up the patch. Actually cpupool_borrow_cpu() does not seem to
>>> lock down the cpu-pool-vcpu relationship while continue_hypercall_on_cpu()
>>> is running. In particular, it is clear that it does nothing if the vcpu is
>>> already part of the pool that the domain is running in. But then what if the
>>> cpu is removed from the pool during the borrow_cpu()/return_cpu() critical
>>> region? It hardly inspires confidence.
>> I checked the use cases.
>> All calls leading to cpupool_borrow_cpu() are done under the domctl lock.
>> The same applies to all cpupool operations.
> 
> Uhhh... How did you figure that one out? I don't think one single caller of
> continue_hypercall_on_cpu() holds the domctl_lock. The callers are all
> sysctls and platform_ops.

Sigh. I just recalled it from memory. Seems I was wrong.

> 
>> I can add an explicit check not to unassign borrowed cpus, if you like.
> 
> Your new interface ought to be responsible for its own synchronisation
> needs. And if it's not you should implement the appropriate assertions
> regarding e.g., spin_is_locked(), plus a code comment. It's simple
> negligence to do neither.

You are right.
I will add a check to ensure borrowed cpus are not allowed to change the pool.


Juergen

-- 
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 636 47950
Fujitsu Technolgy Solutions               e-mail: juergen.gross@xxxxxxxxxxxxxx
Otto-Hahn-Ring 6                        Internet: ts.fujitsu.com
D-81739 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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