From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH] xen/arm: Implement dynamic allocation of irq descriptors Date: Mon, 23 Feb 2015 16:25:15 +0000 Message-ID: <54EB546B.3060409@linaro.org> References: <1424330259-4104-1-git-send-email-vijay.kilari@gmail.com> <54E5ED43.5090808@linaro.org> <54EB49E1.6010809@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 23/02/15 16:09, Vijay Kilari wrote: > On Mon, Feb 23, 2015 at 9:10 PM, Julien Grall wrote: >> Hello Vijay, >> >> On 23/02/15 13:04, Vijay Kilari wrote: >>> On Thu, Feb 19, 2015 at 7:33 PM, Julien Grall wrote: >>>> On 19/02/15 07:17, vijay.kilari@gmail.com wrote: >>>>> From: Vijaya Kumar K >>>>> >>>>> For arm memory for 1024 irq descriptors are allocated >>>>> statically irrespective of number of interrupt supported >>>>> by the platform. >>>>> >>>>> With this patch, irq descriptors are allocated at run time >>>>> and managed using red-black tree. Functions to insert, search >>>>> and delete irq descriptor are implemented in xen/common/irq.c. >>>> >>>> I think we may want to allocate SPIs/SGIs/PPIs at boot time. This number >>>> will never change. We can avoid to always to allocate 1024 IRQs by using >>>> the number provided by the GIC. >>> >>> The irq descriptor is allocated when platform_get_irq() is called or >>> route_irq_to_guest() >>> only. So we are not allocating based on GIC. >> >> You didn't understand what I said... I was suggesting to allocate SPIs >> at boot time. Using an array for them allow us to access to IRQ desc in >> constant time. This may help interrupt latency. > > Yes, I have thought about it. May be we can choose this approach for SPIs > but for LPI's, the GIC can support upto ~32K. So in this case it won't make > sense for LPI's Again... I never said it was a bad idea for LPIs. I was only point out that it may not be worth for SPIs. [..] >> I think we should consider to create a separate structure for LPI's. > > Yes, I have created separate structure for LPI's for ITS driver. > But as I said LPI's are to many, so cannot allocate at domain creation. Ditto. The new structure can be a radix tree. I never suggested to use an array. [..] >>>> What's the matter to put this function on the common code when the >>>> variable itself lives in the architecture code? >>> >>> Which code is common here? >> >> Any file living in xen/common is part of the common code... > > The rb_root variable is in arch specific code. But it is passed as parameter. > The API's to handle addtion/deletion/search based on irq can be use by > other platforms eg. x86 irq_desc being commong structure (xen/include/xen/irq.h) Please add a comment somewhere to explain it. Regards, -- Julien Grall