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 1/2] IRQ: allocate CPU masks dynamically

To: Jan Beulich <JBeulich@xxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/2] IRQ: allocate CPU masks dynamically
From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Date: Thu, 3 Nov 2011 16:02:10 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Keir \(Xen.org\)" <keir@xxxxxxx>
Delivery-date: Thu, 03 Nov 2011 09:12:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EB2C688020000780005ECDF@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>
References: <4EB2B2B5020000780005EBDD@xxxxxxxxxxxxxxxxxxxx> <4EB2A9F5.1060800@xxxxxxxxxx> <4EB2BE9E020000780005EC7F@xxxxxxxxxxxxxxxxxxxx> <4EB2B69A.5030007@xxxxxxxxxx> <4EB2C688020000780005ECDF@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110921 Lightning/1.0b2 Thunderbird/3.1.15
On 03/11/11 15:51, Jan Beulich wrote:
>>>> On 03.11.11 at 16:43, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 03/11/11 15:17, Jan Beulich wrote:
>>>>>> On 03.11.11 at 15:49, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>>>> On 03/11/11 14:26, Jan Beulich wrote:
>>>>> IRQ: allocate CPU masks dynamically
>>>>>
>>>>> This includes delaying the initialization of dynamically created IRQs
>>>>> until their actual first use and some further elimination of uses of
>>>>> struct irq_cfg.
>>>>>
>>>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>>> Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>>>
>>>> One query which may or may not affect the patch.  Would we get better
>>>> caching characteristics if all cpumasks were allocated in consecutive
>>>> memory, rather than having 3 individual allocs in arch_init_one_irq_desc ?
>>> That was what the first version of the patch did, rejected by Keir
>>> (and not liked too much by me either).
>>>
>>> Jan
>> My understanding of the objection was hiding the variables themselves as
>> an array in the code.
>>
>> An alternative approach such as alloc'ing 3*sizeof(cpu mask) (cache
>> aligned) and assigning the relevant pointers to the current
>> cpumask_var_t's would be a suitable approach which causes the cpumasks
>> to be in contiguous memory, but not changing how they are referenced in
>> the code.
> That would mean just open-coding what the former patch did by
> abstraction. In my opinion that is even worse - either we want a
> generally usable mechanism to do this, or we don't do it at all.
>
> Jan

That is an interesting point, but I dont think it is worse.

There are very few cases where we want to be doing this, so open coding
is not too bad.  With a comment explaining why, I would have thought it
would be fine.

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


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