From patchwork Tue Aug 11 03:17:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 40575 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7BC5TIh028866 for ; Tue, 11 Aug 2009 12:05:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbZHKMAU (ORCPT ); Tue, 11 Aug 2009 08:00:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752614AbZHKMAS (ORCPT ); Tue, 11 Aug 2009 08:00:18 -0400 Received: from hera.kernel.org ([140.211.167.34]:35438 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752553AbZHKL7i (ORCPT ); Tue, 11 Aug 2009 07:59:38 -0400 Received: from [10.6.76.26] (sca-ea-fw-1.Sun.COM [192.18.43.225]) (authenticated bits=0) by hera.kernel.org (8.14.2/8.13.8) with ESMTP id n7B3IWvd005724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Aug 2009 03:18:32 GMT Message-ID: <4A80E2E2.5000208@kernel.org> Date: Mon, 10 Aug 2009 20:17:54 -0700 From: Yinghai Lu User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: Jesse Barnes , Ingo Molnar , mingo@redhat.com, hpa@zytor.com, suresh.b.siddha@intel.com, tglx@linutronix.de CC: linux-kernel@vger.kernel.org, "linux-pci@vger.kernel.org" Subject: [PATCH] pci/intr_remapping: allocate irq_iommu on node -v2 References: <4A785C17.3030104@kernel.org> <20090809104400.GA1087@elte.hu> <20090810092921.48c3123f@jbarnes-g45> In-Reply-To: <20090810092921.48c3123f@jbarnes-g45> X-Virus-Scanned: ClamAV 0.93.3/9674/Mon Aug 10 21:07:55 2009 on hera.kernel.org X-Virus-Status: Clean Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org make it use node from irq_desc. also need to make sure legacy irq node is right, when there is no ram on node 0 Signed-off-by: Yinghai Lu --- drivers/pci/intr_remapping.c | 10 +++++++++- kernel/irq/handle.c | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/pci/intr_remapping.c =================================================================== --- linux-2.6.orig/drivers/pci/intr_remapping.c +++ linux-2.6/drivers/pci/intr_remapping.c @@ -79,7 +79,15 @@ static struct irq_2_iommu *irq_2_iommu_a static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq) { - return irq_2_iommu_alloc_node(irq, cpu_to_node(boot_cpu_id)); + int node; + +#ifdef CONFIG_SMP + node = irq_to_desc(irq)->node; +#else + node = cpu_to_node(boot_cpu_id); +#endif + + return irq_2_iommu_alloc_node(irq, node); } #else /* !CONFIG_SPARSE_IRQ */ Index: linux-2.6/kernel/irq/handle.c =================================================================== --- linux-2.6.orig/kernel/irq/handle.c +++ linux-2.6/kernel/irq/handle.c @@ -161,7 +161,7 @@ int __init early_irq_init(void) desc = irq_desc_legacy; legacy_count = ARRAY_SIZE(irq_desc_legacy); - node = first_online_node; + node = first_online_node; /* allocate irq_desc_ptrs array based on nr_irqs */ irq_desc_ptrs = kcalloc(nr_irqs, sizeof(void *), GFP_NOWAIT); @@ -172,6 +172,9 @@ int __init early_irq_init(void) for (i = 0; i < legacy_count; i++) { desc[i].irq = i; +#ifdef CONFIG_SMP + desc[i].node = node; +#endif desc[i].kstat_irqs = kstat_irqs_legacy + i * nr_cpu_ids; lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); alloc_desc_masks(&desc[i], node, true);