mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irq: make sure irq_desc for legacy irq get correct node setting
       [not found] <20090826214323.GC25536@elte.hu>
@ 2009-08-26 23:20 ` Yinghai Lu
  2009-08-26 23:20   ` [PATCH] irq: add irq_node Yinghai Lu
  2009-08-29 13:58   ` [tip:irq/core] irq: Make sure irq_desc for legacy irq get correct node setting tip-bot for Yinghai Lu
  0 siblings, 2 replies; 9+ messages in thread
From: Yinghai Lu @ 2009-08-26 23:20 UTC (permalink / raw)
  To: Ingo Molnar, Jesse Barnes, H. Peter Anvin, Thomas Gleixner, linux-kernel
  Cc: Andrew Morton


when there is no ram on node 0

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 kernel/irq/handle.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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);

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] irq: add irq_node
  2009-08-26 23:20 ` [PATCH] irq: make sure irq_desc for legacy irq get correct node setting Yinghai Lu
@ 2009-08-26 23:20   ` Yinghai Lu
  2009-08-26 23:21     ` [PATCH] pci/intr_remapping: allocate irq_iommu on node -v3 Yinghai Lu
  2009-08-29 13:58     ` [tip:irq/core] irq: Add irq_node() primitive tip-bot for Yinghai Lu
  2009-08-29 13:58   ` [tip:irq/core] irq: Make sure irq_desc for legacy irq get correct node setting tip-bot for Yinghai Lu
  1 sibling, 2 replies; 9+ messages in thread
From: Yinghai Lu @ 2009-08-26 23:20 UTC (permalink / raw)
  To: Ingo Molnar, Jesse Barnes, H. Peter Anvin, Thomas Gleixner, linux-kernel
  Cc: Andrew Morton


to return irq_desc node info

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 include/linux/irqnr.h |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-2.6/include/linux/irqnr.h
===================================================================
--- linux-2.6.orig/include/linux/irqnr.h
+++ linux-2.6/include/linux/irqnr.h
@@ -41,6 +41,12 @@ extern struct irq_desc *irq_to_desc(unsi
 			;						\
 		else
 
+#ifdef CONFIG_SMP
+#define irq_node(irq)	(irq_to_desc(irq)->node)
+#else
+#define irq_node(irq)	0
+#endif
+
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
 #define for_each_irq_nr(irq)                   \

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] pci/intr_remapping: allocate irq_iommu on node -v3
  2009-08-26 23:20   ` [PATCH] irq: add irq_node Yinghai Lu
@ 2009-08-26 23:21     ` Yinghai Lu
  2009-08-29 13:58       ` [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node tip-bot for Yinghai Lu
  2009-08-29 13:58     ` [tip:irq/core] irq: Add irq_node() primitive tip-bot for Yinghai Lu
  1 sibling, 1 reply; 9+ messages in thread
From: Yinghai Lu @ 2009-08-26 23:21 UTC (permalink / raw)
  To: Ingo Molnar, Jesse Barnes, H. Peter Anvin, Thomas Gleixner, linux-kernel
  Cc: Andrew Morton


make it use node from irq_desc.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>

---
 drivers/pci/intr_remapping.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

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
@@ -55,15 +55,12 @@ static struct irq_2_iommu *irq_2_iommu(u
 	return desc->irq_2_iommu;
 }
 
-static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node)
+static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
 {
 	struct irq_desc *desc;
 	struct irq_2_iommu *irq_iommu;
 
-	/*
-	 * alloc irq desc if not allocated already.
-	 */
-	desc = irq_to_desc_alloc_node(irq, node);
+	desc = irq_to_desc(irq);
 	if (!desc) {
 		printk(KERN_INFO "can not get irq_desc for %d\n", irq);
 		return NULL;
@@ -72,16 +69,11 @@ static struct irq_2_iommu *irq_2_iommu_a
 	irq_iommu = desc->irq_2_iommu;
 
 	if (!irq_iommu)
-		desc->irq_2_iommu = get_one_free_irq_2_iommu(node);
+		desc->irq_2_iommu = get_one_free_irq_2_iommu(irq_node(irq));
 
 	return desc->irq_2_iommu;
 }
 
-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));
-}
-
 #else /* !CONFIG_SPARSE_IRQ */
 
 static struct irq_2_iommu irq_2_iommuX[NR_IRQS];

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:irq/core] irq: Make sure irq_desc for legacy irq get correct node setting
  2009-08-26 23:20 ` [PATCH] irq: make sure irq_desc for legacy irq get correct node setting Yinghai Lu
  2009-08-26 23:20   ` [PATCH] irq: add irq_node Yinghai Lu
@ 2009-08-29 13:58   ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 9+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-08-29 13:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, jbarnes, akpm, tglx, mingo

Commit-ID:  372e24b0cb764ec55b4cf3408a95ae40a29e5b96
Gitweb:     http://git.kernel.org/tip/372e24b0cb764ec55b4cf3408a95ae40a29e5b96
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 26 Aug 2009 16:20:13 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 29 Aug 2009 15:53:00 +0200

irq: Make sure irq_desc for legacy irq get correct node setting

when there is no ram on node 0.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
LKML-Reference: <4A95C32D.5040605@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/irq/handle.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index 065205b..a81cf80 100644
--- a/kernel/irq/handle.c
+++ b/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);

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:irq/core] irq: Add irq_node() primitive
  2009-08-26 23:20   ` [PATCH] irq: add irq_node Yinghai Lu
  2009-08-26 23:21     ` [PATCH] pci/intr_remapping: allocate irq_iommu on node -v3 Yinghai Lu
@ 2009-08-29 13:58     ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 9+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-08-29 13:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, jbarnes, akpm, tglx, mingo

Commit-ID:  5bfb5b51382f4bd01d9ced11503264d2cc74fe41
Gitweb:     http://git.kernel.org/tip/5bfb5b51382f4bd01d9ced11503264d2cc74fe41
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 26 Aug 2009 16:20:48 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 29 Aug 2009 15:53:00 +0200

irq: Add irq_node() primitive

... to return irq_desc node info without #ifdefs at the callsites.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
LKML-Reference: <4A95C350.8060308@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 include/linux/irqnr.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index ec87b21..7bf89bc 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -41,6 +41,12 @@ extern struct irq_desc *irq_to_desc(unsigned int irq);
 			;						\
 		else
 
+#ifdef CONFIG_SMP
+#define irq_node(irq)	(irq_to_desc(irq)->node)
+#else
+#define irq_node(irq)	0
+#endif
+
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
 #define for_each_irq_nr(irq)                   \

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node
  2009-08-26 23:21     ` [PATCH] pci/intr_remapping: allocate irq_iommu on node -v3 Yinghai Lu
@ 2009-08-29 13:58       ` tip-bot for Yinghai Lu
  0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-08-29 13:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, akpm, jbarnes, tglx, mingo

Commit-ID:  70590ea75b7f9ef4846b0b0f4400e8338dbcc7eb
Gitweb:     http://git.kernel.org/tip/70590ea75b7f9ef4846b0b0f4400e8338dbcc7eb
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Wed, 26 Aug 2009 16:21:54 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 29 Aug 2009 15:53:01 +0200

pci/intr_remapping: Allocate irq_iommu on node

make it use the node from irq_desc.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4A95C392.5050903@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 drivers/pci/intr_remapping.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 4f5b871..4480364 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -55,15 +55,12 @@ static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
 	return desc->irq_2_iommu;
 }
 
-static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node)
+static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
 {
 	struct irq_desc *desc;
 	struct irq_2_iommu *irq_iommu;
 
-	/*
-	 * alloc irq desc if not allocated already.
-	 */
-	desc = irq_to_desc_alloc_node(irq, node);
+	desc = irq_to_desc(irq);
 	if (!desc) {
 		printk(KERN_INFO "can not get irq_desc for %d\n", irq);
 		return NULL;
@@ -72,16 +69,11 @@ static struct irq_2_iommu *irq_2_iommu_alloc_node(unsigned int irq, int node)
 	irq_iommu = desc->irq_2_iommu;
 
 	if (!irq_iommu)
-		desc->irq_2_iommu = get_one_free_irq_2_iommu(node);
+		desc->irq_2_iommu = get_one_free_irq_2_iommu(irq_node(irq));
 
 	return desc->irq_2_iommu;
 }
 
-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));
-}
-
 #else /* !CONFIG_SPARSE_IRQ */
 
 static struct irq_2_iommu irq_2_iommuX[NR_IRQS];

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node
  2009-08-09 10:44   ` Ingo Molnar
@ 2009-08-10 16:29     ` Jesse Barnes
  0 siblings, 0 replies; 9+ messages in thread
From: Jesse Barnes @ 2009-08-10 16:29 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: mingo, hpa, linux-kernel, yinghai, suresh.b.siddha, tglx,
	linux-tip-commits

On Sun, 9 Aug 2009 12:44:00 +0200
Ingo Molnar <mingo@elte.hu> wrote:

> 
> * tip-bot for Yinghai Lu <yinghai@kernel.org> wrote:
> 
> > Commit-ID:  94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
> > Gitweb:
> > http://git.kernel.org/tip/94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
> > Author:     Yinghai Lu <yinghai@kernel.org> AuthorDate: Tue, 4 Aug
> > 2009 09:04:39 -0700 Committer:  Ingo Molnar <mingo@elte.hu>
> > CommitDate: Sat, 8 Aug 2009 17:07:37 +0200
> > 
> > pci/intr_remapping: Allocate irq_iommu on node
> 
> -tip testing found that this patch broke the x86 build:
> 
> drivers/pci/intr_remapping.c: In function ‘alloc_irte’:
> drivers/pci/intr_remapping.c:204: error: ‘struct irq_desc’ has no
> member named ‘node’ drivers/pci/intr_remapping.c: In function
> ‘set_irte_irq’: drivers/pci/intr_remapping.c:258: error: ‘struct
> irq_desc’ has no member named ‘node’

Looks like we need a wrapper function for this with proper CONFIG_NUMA
checks...  I'll apply it to my linux-next tree when someone sends me a
new version.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node
  2009-08-08 15:22 ` [tip:irq/core] pci/intr_remapping: Allocate " tip-bot for Yinghai Lu
@ 2009-08-09 10:44   ` Ingo Molnar
  2009-08-10 16:29     ` Jesse Barnes
  0 siblings, 1 reply; 9+ messages in thread
From: Ingo Molnar @ 2009-08-09 10:44 UTC (permalink / raw)
  To: mingo, hpa, linux-kernel, yinghai, jbarnes, suresh.b.siddha, tglx
  Cc: linux-tip-commits


* tip-bot for Yinghai Lu <yinghai@kernel.org> wrote:

> Commit-ID:  94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
> Gitweb:     http://git.kernel.org/tip/94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
> Author:     Yinghai Lu <yinghai@kernel.org>
> AuthorDate: Tue, 4 Aug 2009 09:04:39 -0700
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Sat, 8 Aug 2009 17:07:37 +0200
> 
> pci/intr_remapping: Allocate irq_iommu on node

-tip testing found that this patch broke the x86 build:

drivers/pci/intr_remapping.c: In function ‘alloc_irte’:
drivers/pci/intr_remapping.c:204: error: ‘struct irq_desc’ has no member named ‘node’
drivers/pci/intr_remapping.c: In function ‘set_irte_irq’:
drivers/pci/intr_remapping.c:258: error: ‘struct irq_desc’ has no member named ‘node’

	Ingo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node
  2009-08-04 16:04 [PATCH] pci/intr_remapping: allocate irq_iommu on node Yinghai Lu
@ 2009-08-08 15:22 ` tip-bot for Yinghai Lu
  2009-08-09 10:44   ` Ingo Molnar
  0 siblings, 1 reply; 9+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-08-08 15:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, jbarnes, suresh.b.siddha, tglx, mingo

Commit-ID:  94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
Gitweb:     http://git.kernel.org/tip/94fb9a6b49d3a63831c4e752f6f0ab8da0a99eb5
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Tue, 4 Aug 2009 09:04:39 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 8 Aug 2009 17:07:37 +0200

pci/intr_remapping: Allocate irq_iommu on node

Make it use node from irq_desc - this results in more
optimal memory layout.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <4A785C17.3030104@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 drivers/pci/intr_remapping.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 4f5b871..e27a28c 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -201,7 +201,7 @@ int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
 	for (i = index; i < index + count; i++)
 		table->base[i].present = 1;
 
-	irq_iommu = irq_2_iommu_alloc(irq);
+	irq_iommu = irq_2_iommu_alloc_node(irq, irq_to_desc(irq)->node);
 	if (!irq_iommu) {
 		spin_unlock_irqrestore(&irq_2_ir_lock, flags);
 		printk(KERN_ERR "can't allocate irq_2_iommu\n");
@@ -255,7 +255,7 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
 
 	spin_lock_irqsave(&irq_2_ir_lock, flags);
 
-	irq_iommu = irq_2_iommu_alloc(irq);
+	irq_iommu = irq_2_iommu_alloc_node(irq, irq_to_desc(irq)->node);
 
 	if (!irq_iommu) {
 		spin_unlock_irqrestore(&irq_2_ir_lock, flags);

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-08-29 13:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20090826214323.GC25536@elte.hu>
2009-08-26 23:20 ` [PATCH] irq: make sure irq_desc for legacy irq get correct node setting Yinghai Lu
2009-08-26 23:20   ` [PATCH] irq: add irq_node Yinghai Lu
2009-08-26 23:21     ` [PATCH] pci/intr_remapping: allocate irq_iommu on node -v3 Yinghai Lu
2009-08-29 13:58       ` [tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node tip-bot for Yinghai Lu
2009-08-29 13:58     ` [tip:irq/core] irq: Add irq_node() primitive tip-bot for Yinghai Lu
2009-08-29 13:58   ` [tip:irq/core] irq: Make sure irq_desc for legacy irq get correct node setting tip-bot for Yinghai Lu
2009-08-04 16:04 [PATCH] pci/intr_remapping: allocate irq_iommu on node Yinghai Lu
2009-08-08 15:22 ` [tip:irq/core] pci/intr_remapping: Allocate " tip-bot for Yinghai Lu
2009-08-09 10:44   ` Ingo Molnar
2009-08-10 16:29     ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome