Re: [PATCH] pcibus_to_node implementation for IA64

From: Christoph Lameter <>
Date: 2005-06-24 09:08:43
On Thu, 23 Jun 2005, Alex Williamson wrote:

>   Cool.  It works on an rx8620 here.  I forgot to wrap the generic setup
> in a NUMA config.  The below chunks should replace the sba_iommu chunk
> in the original patch.  Thanks,

Great. Tony I am going to split off my patch into two pieces, one generic 
and one Altix specific. Alex's patch implements the HP subarch support 
and the patch that I am going to send separately will implement Altix 
subarch support.

Here is the generic stuff for ia64 pcibus to node support:


[PATCH] pcibus_to_node implementation for IA64

pcibus_to_node provides a way for the Linux kernel to identify to which node
a certain pcibus connect to. Allocations of control structures for devices can then be
made on the node where the pci bus is located to allow local access during interrupt and
other device manipulation.

The numa aware block layer patch now in Linus tree relies on pcibus_to_node
to allocate block device control structures on the correct node. There is a pending
patch for an ethernet driver to allocate the descriptors on the node of each ethernet device.

This patch only provides an extension of the the pci_controller structure and will make
pcibus_to_node return -1 (undetermined) by default. Separate patches for HP and SGI will
be needed to make subarches return useful node information.

Signed-off-by: Christoph Lameter <>

Index: linux-2.6.12/include/asm-ia64/pci.h
--- linux-2.6.12.orig/include/asm-ia64/pci.h	2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.12/include/asm-ia64/pci.h	2005-06-23 15:57:26.000000000 -0700
@@ -109,6 +109,7 @@ struct pci_controller {
 	void *acpi_handle;
 	void *iommu;
 	int segment;
+	int node;		/* nearest node with memory or -1 for global allocation */
 	unsigned int windows;
 	struct pci_window *window;
Index: linux-2.6.12/include/asm-ia64/topology.h
--- linux-2.6.12.orig/include/asm-ia64/topology.h	2005-06-17 12:48:29.000000000 -0700
+++ linux-2.6.12/include/asm-ia64/topology.h	2005-06-23 15:57:26.000000000 -0700
@@ -40,6 +40,11 @@
 #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node)))
+ * Determines the node for a given pci bus
+ */
+#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
 void build_cpu_to_node_map(void);
 /* sched_domains SD_NODE_INIT for IA64 NUMA machines */
Index: linux-2.6.12/arch/ia64/pci/pci.c
--- linux-2.6.12.orig/arch/ia64/pci/pci.c	2005-06-23 15:53:53.000000000 -0700
+++ linux-2.6.12/arch/ia64/pci/pci.c	2005-06-23 15:57:26.000000000 -0700
@@ -157,6 +157,7 @@ alloc_pci_controller (int seg)
 	memset(controller, 0, sizeof(*controller));
 	controller->segment = seg;
+	controller->node = -1;
 	return controller;

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Thu Jun 23 19:08:55 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:40 EST