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 panic when adjusting sedf parameters

To: Keir Fraser <keir.xen@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Avoid panic when adjusting sedf parameters
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Thu, 17 Nov 2011 15:02:46 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jan Beulich <JBeulich@xxxxxxxx>
Delivery-date: Thu, 17 Nov 2011 06:07:39 -0800
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1321538571; x=1353074571; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; bh=6prDOhl5+6E8l21XsW1ASinIO3HZxQYU3364uy0BkrQ=; b=PK8jr/S4UGITMWlgC5vFBNoRSbXhaT9uKMYYOT+8oqREDasbjhfYP1RY y9LapvqwfWuA+Fc5qyIQcZqyhSaQnL4Xtx2EXXAOmhceYMJcGm7Bn8DF7 +KM/ZK0X6pGBorOk9E05VP8yMfajimg7TvLVUZKEcwyqdFL0f3NZUdLoW r5yTyuPJKMDqYpCXs/daE8XNc/1bvQ9/ewQgcyBRQ2es3pjkM3Rn8Z733 toAwQ4mVXt0zyjZTb2ByHp4y60lJx;
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=hWvfzQXc7Ty8MYpdBFr3ZM1FaVCuN8E2zRMJT5S/JRxMfdxLRWkMkSih Jtx5lfoGwQ5qRmYXJz3Q1zS1O+v8jkK2MUv+UGEyIxjVExZ3mWPROAMbJ kpVJyhBPDYx7L3LPoHltOH09C1q+bWAEpY5Sgx+I8REGeRc7iSsXkd5jT vCpJQ/qPmKkpii/tXWEW/40GO7axGAfGhNp7OoOvb/qqrNseGI3jsKhiz WtD83GcawQ9Y8EizPp9H2CxsBhswY;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAEAC134.25132%keir.xen@xxxxxxxxx>
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: <CAEAC134.25132%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20111010 Iceowl/1.0b2 Icedove/3.1.15
On 11/17/2011 02:48 PM, Keir Fraser wrote:
On 17/11/2011 13:30, "Jan Beulich"<JBeulich@xxxxxxxx>  wrote:

+#define for_each_domain_in_cpupool(_d,_c)       \
+ for ( (_d) = rcu_dereference(domain_list);     \
+       (_d) != NULL;                            \
+       (_d) = rcu_dereference((_d)->next_in_list )) \
Wouldn't this, up to here, simply be for_each_domain()?

+       if ((_d)->cpupool == (_c))
This is dangerous - consider code like
I also wonder (and this is true for the existing open-coded versions too)
whether we have sufficient locking around use of d->cpupool? Do these loops
hold enough locks to ensure that d->cpupool doesn't change under their feet?

d->cpupool is changed in three functions:

I was just preparing a patch for cpupool_unassign_cpu() which is lacking
rcu_lock_domain().
cpupool_add_domain() is called only for domains not yet in the domain list.
sched_move_domain() is only called with domain lock held.


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
PDG 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