Skip to contentSkip to conversation

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

PATCH In review Yinghai Lu 1 participant 6 messages Aug 26, 2009 – Aug 29, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Yinghai Lu

author
#1 lore raw

PATCH 1/1 irq: make sure irq_desc for legacy irq get correct node setting

when there is no ram on node 0

---
 kernel/irq/handle.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/irq/handle.c +4 -1
Index: 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);
author
#2 lore raw

PATCH 1/1 irq: add irq_node

to return irq_desc node info

---
 include/linux/irqnr.h |    6 ++++++
 1 file changed, 6 insertions(+)
include/linux/irqnr.h +6 -0
Index: 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)                   \
author
#3 lore raw

PATCH 1/1 pci/intr_remapping: allocate irq_iommu on node -v3

make it use node from irq_desc.

---
 drivers/pci/intr_remapping.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
drivers/pci/intr_remapping.c +3 -11
Index: 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];
#4 lore raw

[tip:irq/core] pci/intr_remapping: Allocate irq_iommu on node

Commit-ID:  70590ea75b7f9ef4846b0b0f4400e8338dbcc7eb
Gitweb:     http://git.kernel.org/tip/70590ea75b7f9ef4846b0b0f4400e8338dbcc7eb
Author:     Yinghai Lu <[email protected]>
AuthorDate: Wed, 26 Aug 2009 16:21:54 -0700
Committer:  Ingo Molnar <[email protected]>
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.

LKML-Reference: <[email protected]>

---
 drivers/pci/intr_remapping.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
drivers/pci/intr_remapping.c +3 -11
index 4f5b871..4480364 100644
@@ -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];
#5 lore raw

[tip:irq/core] irq: Add irq_node() primitive

In reply to Yinghai Lu
Commit-ID:  5bfb5b51382f4bd01d9ced11503264d2cc74fe41
Gitweb:     http://git.kernel.org/tip/5bfb5b51382f4bd01d9ced11503264d2cc74fe41
Author:     Yinghai Lu <[email protected]>
AuthorDate: Wed, 26 Aug 2009 16:20:48 -0700
Committer:  Ingo Molnar <[email protected]>
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.

Cc Andrew Morton <[email protected]>
Cc Jesse Barnes <[email protected]>

LKML-Reference: <[email protected]>

---
 include/linux/irqnr.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/irqnr.h +6 -0
index ec87b21..7bf89bc 100644
@@ -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)                   \
#6 lore raw

[tip:irq/core] irq: Make sure irq_desc for legacy irq get correct node setting

In reply to Yinghai Lu
Commit-ID:  372e24b0cb764ec55b4cf3408a95ae40a29e5b96
Gitweb:     http://git.kernel.org/tip/372e24b0cb764ec55b4cf3408a95ae40a29e5b96
Author:     Yinghai Lu <[email protected]>
AuthorDate: Wed, 26 Aug 2009 16:20:13 -0700
Committer:  Ingo Molnar <[email protected]>
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.

Cc Andrew Morton <[email protected]>
Cc Jesse Barnes <[email protected]>

LKML-Reference: <[email protected]>

---
 kernel/irq/handle.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
kernel/irq/handle.c +4 -1
index 065205b..a81cf80 100644
@@ -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);