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: Jan Beulich <JBeulich@xxxxxxxx>, Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Avoid panic when adjusting sedf parameters
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Thu, 17 Nov 2011 13:52:48 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 17 Nov 2011 05:53:38 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=HiPbjF5Q/GJ21ygk3RWsQytOpe7Q3gw4C96FSPtRB0o=; b=gudawA2vR/MiNQU9NtCjqg+4D5qnSpO/lNEMJAxULO3b482pvRz4Vqe2s/P/YOaS/s wvR4wrpKZ5ZKSCLEtJOCp/xFKFh/8Pozd6yXOXwbVFr0xo7qTezA39fTxvh9oGDL3Dsa kUNyEqt/KqrZhTnszit6zIyoi9+jGru0oLsn0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EC51A8D0200007800061933@xxxxxxxxxxxxxxxxxxxx>
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: AcylMDCkouJTEqHWkk25vYsthNixeQ==
Thread-topic: [Xen-devel] [PATCH] Avoid panic when adjusting sedf parameters
User-agent: Microsoft-Entourage/12.31.0.110725
On 17/11/2011 13:30, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

> which would now associate the else with the wrong (inner) if. One
> possible solution that comes to mind would be
> 
> #define for_each_domain_in_cpupool(_d,_c) \
>     for_each_domain_in_cpupool (_d) \
>         if ((_d)->cpupool != (_c)) \
>             continue; \
>         else
> 
> but I think I had seen a more clever solution to this problem, but cannot
> remember/locate it right now.

Given the gcc ({}) construction, you could do a double-loop:
 for ( (_d) = rcu_dereference(domain_list);     \
       (_d) != NULL;                            \
       ({ while ((_d) = rcu_dereference((_d)->next_in_list != NULL)
             if ((_d)->cpupool == (_c)) break;
          (_d); }) )

A bit ugly. ;-) And I still worry about cpupool locking...

 -- Keir



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