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] adjust the way cpumasks get passed around

To: Jan Beulich <JBeulich@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] adjust the way cpumasks get passed around
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Wed, 20 May 2009 06:39:24 -0700
Cc:
Delivery-date: Wed, 20 May 2009 06:40:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A141FAD0200007800001C92@xxxxxxxxxxxxxxxxxx>
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: AcnZTdQ/wYK/yQy8TYe4E03tQfox0wAAo7aS
Thread-topic: [Xen-devel] [PATCH] adjust the way cpumasks get passed around
User-agent: Microsoft-Entourage/12.17.0.090302
On 20/05/2009 06:20, "Jan Beulich" <JBeulich@xxxxxxxxxx> wrote:

> Rather than passing cpumasks by value in all cases (which is problematic
> for large NR_CPUS configurations), pass them by value only if they are
> not wider than a pointer; in all other cases, pass them 'by reference'
> (i.e. through a pointer to a const cpumask).
> 
> On x86 this changes send_IPI_mask() to always only send IPIs to remote
> CPUs (meaning any caller needing to handle the current CPU as well has
> to do so on its own).
> 
> Since the patch touches on_selected_cpus() parameters anyway, it at
> once removes that function's (and then for consistency also
> on_each_cpu()'s as well as smp_call_function()'s similar) dead "retry"
> parameter.

Removing the unused retry parameters belongs in a separate patch.

I don't like the conditional pass-by-ref/value approach. We end up with yet
another layer of macro abstraction and names in cpumask.h, and it means
different builds may yield different bugs (pass-by-ref is riskier since the
cpumask can change under the callee's feet, and this would be the rarer case
for testing since requires a wide cpumask at build time).

So, I can agree with using pass-by-ref, but then please just make a patch to
do that always. And put the unrelated cleanups in a separate patch please.

 -- Keir



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

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