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>, "Juergen Gross" <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Avoid panic when adjusting sedf parameters
From: "Jan Beulich" <JBeulich@xxxxxxxx>
Date: Thu, 17 Nov 2011 14:29:09 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 17 Nov 2011 06:30:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAEAC230.25135%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>
References: <4EC51A8D0200007800061933@xxxxxxxxxxxxxxxxxxxx> <CAEAC230.25135%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 17.11.11 at 14:52, Keir Fraser <keir.xen@xxxxxxxxx> wrote:
> 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...

No - the very first domain would make into the body of the loop
without its pool being checked. The (adjusted) construct would
need to go into the checking (middle) portion of the for.

Jan


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