From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Lu Subject: Re: [patch 00/47] Sparse irq rework Date: Sun, 10 Oct 2010 19:20:51 -0700 Message-ID: <4CB27483.1000109@kernel.org> References: <20100930221351.682772535@linutronix.de> <20101003112312.GB9844@angua.secretlab.ca> <20101003112920.GB32736@n2100.arm.linux.org.uk> <4CACFC23.4080504@kernel.org> <4CAD082B.40908@kernel.org> <4CAD1154.3080403@kernel.org> <4CAD4EC3.5060809@kernel.org> <4CAFEEFA.1070000@kernel.org> <4CB00122.3030301@kernel.org> <4CB014F5.5080209@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from rcsinet10.oracle.com ([148.87.113.121]:34082 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752029Ab0JKCXN (ORCPT ); Sun, 10 Oct 2010 22:23:13 -0400 In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Thomas Gleixner Cc: Grant Likely , Russell King - ARM Linux , LKML , linux-arch@vger.kernel.org, Linus Torvalds , Andrew Morton , x86@kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Paul Mundt , David Woodhouse , Jesse Barnes , "Eric W. Biederman" On 10/10/2010 02:32 AM, Thomas Gleixner wrote: > On Sat, 9 Oct 2010, Yinghai Lu wrote: >> On 10/08/2010 11:34 PM, Thomas Gleixner wrote: >>> On Fri, 8 Oct 2010, Yinghai Lu wrote: >>>> + /* only handle fall out from setup_IO_APIC_irqs() */ >>> >>> What's the fallout ? And why are we coming here in the first place >>> when the irq is < 16 ? >> >> setup_IO_APIC_irqs only handle apic_id == 0 or apic_id > 0 but irq < 16 via acpi override. >> >> it seems IBM's system have apic_id == 1, and sci irq is using 30. >> >> so at that time add that setup_IO_APIC_irq_extra() to workaround it. >> but it seems we set that two time when irq < 16. >> >>> >>>> + if (!((apic_id > 0) && (irq > 16))) >>>> + return; > > I added this into the queue, but simplified it to > > if (apic_id == 0 || irq < NR_IRQS_LEGACY) > > Folded in the other fix and pushed out an updated tree. > ok. please check another small fix. diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index b3805f3..2fb9df4 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -130,10 +130,11 @@ static struct irq_desc *alloc_desc(int irq, int node) desc = kzalloc_node(sizeof(*desc), gfp, node); if (!desc) return NULL; + /* allocate based on nr_cpu_ids */ desc->kstat_irqs = kzalloc_node(nr_cpu_ids * sizeof(*desc->kstat_irqs), gfp, node); - if (!desc) + if (!desc->kstat_irqs) goto err_desc; if (alloc_masks(desc, gfp, node)) @@ -226,6 +227,7 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { static unsigned int kstat_irqs_all[NR_IRQS][NR_CPUS]; int __init early_irq_init(void) { + int node = first_online_node; struct irq_desc *desc; int count; int i; @@ -241,8 +243,8 @@ int __init early_irq_init(void) desc[i].irq_data.irq = i; desc[i].irq_data.chip = &no_irq_chip; desc[i].kstat_irqs = kstat_irqs_all[i]; - alloc_masks(desc + i, GFP_KERNEL, first_online_node); - desc_smp_init(desc + i, first_online_node); + alloc_masks(desc + i, GFP_KERNEL, node); + desc_smp_init(desc + i, node); lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); } return arch_early_irq_init(); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcsinet10.oracle.com ([148.87.113.121]:34082 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752029Ab0JKCXN (ORCPT ); Sun, 10 Oct 2010 22:23:13 -0400 Message-ID: <4CB27483.1000109@kernel.org> Date: Sun, 10 Oct 2010 19:20:51 -0700 From: Yinghai Lu MIME-Version: 1.0 Subject: Re: [patch 00/47] Sparse irq rework References: <20100930221351.682772535@linutronix.de> <20101003112312.GB9844@angua.secretlab.ca> <20101003112920.GB32736@n2100.arm.linux.org.uk> <4CACFC23.4080504@kernel.org> <4CAD082B.40908@kernel.org> <4CAD1154.3080403@kernel.org> <4CAD4EC3.5060809@kernel.org> <4CAFEEFA.1070000@kernel.org> <4CB00122.3030301@kernel.org> <4CB014F5.5080209@kernel.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Thomas Gleixner Cc: Grant Likely , Russell King - ARM Linux , LKML , linux-arch@vger.kernel.org, Linus Torvalds , Andrew Morton , x86@kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Paul Mundt , David Woodhouse , Jesse Barnes , "Eric W. Biederman" Message-ID: <20101011022051.ZZ3n7DfaVOqGr44s6Jvbx7cC9DseXPnYVrrwyv6r5Hs@z> On 10/10/2010 02:32 AM, Thomas Gleixner wrote: > On Sat, 9 Oct 2010, Yinghai Lu wrote: >> On 10/08/2010 11:34 PM, Thomas Gleixner wrote: >>> On Fri, 8 Oct 2010, Yinghai Lu wrote: >>>> + /* only handle fall out from setup_IO_APIC_irqs() */ >>> >>> What's the fallout ? And why are we coming here in the first place >>> when the irq is < 16 ? >> >> setup_IO_APIC_irqs only handle apic_id == 0 or apic_id > 0 but irq < 16 via acpi override. >> >> it seems IBM's system have apic_id == 1, and sci irq is using 30. >> >> so at that time add that setup_IO_APIC_irq_extra() to workaround it. >> but it seems we set that two time when irq < 16. >> >>> >>>> + if (!((apic_id > 0) && (irq > 16))) >>>> + return; > > I added this into the queue, but simplified it to > > if (apic_id == 0 || irq < NR_IRQS_LEGACY) > > Folded in the other fix and pushed out an updated tree. > ok. please check another small fix. diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index b3805f3..2fb9df4 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -130,10 +130,11 @@ static struct irq_desc *alloc_desc(int irq, int node) desc = kzalloc_node(sizeof(*desc), gfp, node); if (!desc) return NULL; + /* allocate based on nr_cpu_ids */ desc->kstat_irqs = kzalloc_node(nr_cpu_ids * sizeof(*desc->kstat_irqs), gfp, node); - if (!desc) + if (!desc->kstat_irqs) goto err_desc; if (alloc_masks(desc, gfp, node)) @@ -226,6 +227,7 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { static unsigned int kstat_irqs_all[NR_IRQS][NR_CPUS]; int __init early_irq_init(void) { + int node = first_online_node; struct irq_desc *desc; int count; int i; @@ -241,8 +243,8 @@ int __init early_irq_init(void) desc[i].irq_data.irq = i; desc[i].irq_data.chip = &no_irq_chip; desc[i].kstat_irqs = kstat_irqs_all[i]; - alloc_masks(desc + i, GFP_KERNEL, first_online_node); - desc_smp_init(desc + i, first_online_node); + alloc_masks(desc + i, GFP_KERNEL, node); + desc_smp_init(desc + i, node); lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); } return arch_early_irq_init();