From: Jesse Barnes <jbarnes@engr.sgi.com>
To: colpatch@us.ibm.com
Cc: Christoph Hellwig <hch@infradead.org>,
Jesse Barnes <jbarnes@sgi.com>, Andi Kleen <ak@suse.de>,
LKML <linux-kernel@vger.kernel.org>,
"Martin J. Bligh" <mbligh@aracnet.com>,
LSE Tech <lse-tech@lists.sourceforge.net>
Subject: Re: [Lse-tech] [RFC][PATCH] Change pcibus_to_cpumask() to pcibus_to_node()
Date: Fri, 30 Jul 2004 08:36:32 -0700 [thread overview]
Message-ID: <200407300836.32812.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <1091139818.4070.7.camel@arrakis>
[-- Attachment #1: Type: text/plain, Size: 1007 bytes --]
On Thursday, July 29, 2004 3:23 pm, Matthew Dobson wrote:
> What I'm doing is basically ripping out all the old pcibus_to_cpumask()
> calls. The only arch that defined it to be anything other than
> CPU_MASK_ALL was i386, and theirs should still work. x86_64 had the
> beginnings of a PCI bus to CPU mask mapping, but it was never filled in,
> just populated with CPU_MASK_ALL, so it does the same with NODE_MASK_ALL
> now. Those two arches, in their include/asm-$ARCH/topology.h define
> both ARCH_HAS_GET_PCIBUS_NODEMASK and get_pcibus_nodemask(bus).
> include/linux/topology.h defines a simple get_pcibus_nodemask(bus) if
> there isn't an arch-specific one provided. We then, in
> drivers/pci/probe.c, populate the nodemask field of struct pci_bus with
> this nodemask. Lookup involves simply returning the nodemask stored in
> the struct pci_bus.
I think this will work. My tree didn't have nodemask_t though, so it didn't
compile :) Here's a first stab at an ia64 portion of the patch.
Jesse
[-- Attachment #2: pci-bus-to-node-ia64.patch --]
[-- Type: text/plain, Size: 3874 bytes --]
===== arch/ia64/sn/io/machvec/pci_dma.c 1.30 vs edited =====
--- 1.30/arch/ia64/sn/io/machvec/pci_dma.c 2004-03-26 06:33:08 -08:00
+++ edited/arch/ia64/sn/io/machvec/pci_dma.c 2004-07-30 08:38:05 -07:00
@@ -662,6 +662,19 @@
return 0;
}
+/**
+ * sn_get_pcibus_nodemask - return set of nearby nodes for a given PCI bus
+ * @bus: bus number
+ *
+ * Return a nodemask_t with nearby node(s).
+ */
+nodemask_t sn_get_pcibus_nodemask(int bus)
+{
+ nodemask_t nodes;
+ nodes_clear(nodes);
+ return node_set(nasid_to_cnode(busnum_to_nid[bus]), nodes);
+}
+
EXPORT_SYMBOL(sn_dma_mapping_error);
EXPORT_SYMBOL(sn_pci_unmap_single);
EXPORT_SYMBOL(sn_pci_map_single);
===== include/asm-ia64/io.h 1.19 vs edited =====
--- 1.19/include/asm-ia64/io.h 2004-02-03 21:31:10 -08:00
+++ edited/include/asm-ia64/io.h 2004-07-30 08:37:56 -07:00
@@ -391,6 +391,11 @@
# define outl_p outl
#endif
+static inline nodemask_t __ia64_get_pcibus_nodemask(int bus)
+{
+ return NODE_MASK_ALL;
+}
+
/*
* An "address" in IO memory space is not clearly either an integer or a pointer. We will
* accept both, thus the casts.
===== include/asm-ia64/machvec.h 1.25 vs edited =====
--- 1.25/include/asm-ia64/machvec.h 2004-07-10 17:14:00 -07:00
+++ edited/include/asm-ia64/machvec.h 2004-07-30 08:38:35 -07:00
@@ -70,6 +70,7 @@
typedef unsigned short ia64_mv_readw_relaxed_t (void *);
typedef unsigned int ia64_mv_readl_relaxed_t (void *);
typedef unsigned long ia64_mv_readq_relaxed_t (void *);
+typedef nodemask_t ia64_mv_get_pcibus_nodemask_t (int bus);
static inline void
machvec_noop (void)
@@ -138,6 +139,7 @@
# define platform_readw_relaxed ia64_mv.readw_relaxed
# define platform_readl_relaxed ia64_mv.readl_relaxed
# define platform_readq_relaxed ia64_mv.readq_relaxed
+# define platform_get_pcibus_nodemask ia64_mv.get_pcibus_nodemask
# endif
/* __attribute__((__aligned__(16))) is required to make size of the
@@ -184,6 +186,7 @@
ia64_mv_readw_relaxed_t *readw_relaxed;
ia64_mv_readl_relaxed_t *readl_relaxed;
ia64_mv_readq_relaxed_t *readq_relaxed;
+ ia64_mv_get_pcibus_nodemask_t *get_pcibus_nodemask;
} __attribute__((__aligned__(16))); /* align attrib? see above comment */
#define MACHVEC_INIT(name) \
@@ -226,6 +229,7 @@
platform_readw_relaxed, \
platform_readl_relaxed, \
platform_readq_relaxed, \
+ platform_get_pcibus_nodemask, \
}
extern struct ia64_machine_vector ia64_mv;
@@ -367,6 +371,9 @@
#endif
#ifndef platform_readq_relaxed
# define platform_readq_relaxed __ia64_readq_relaxed
+#endif
+#ifndef platform_get_pcibus_nodemask
+# define platform_get_pcibus_nodemask __ia64_get_pcibus_nodemask
#endif
#endif /* _ASM_IA64_MACHVEC_H */
===== include/asm-ia64/machvec_sn2.h 1.14 vs edited =====
--- 1.14/include/asm-ia64/machvec_sn2.h 2004-07-10 17:14:00 -07:00
+++ edited/include/asm-ia64/machvec_sn2.h 2004-07-30 08:31:29 -07:00
@@ -69,6 +69,7 @@
extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device;
extern ia64_mv_dma_mapping_error sn_dma_mapping_error;
extern ia64_mv_dma_supported sn_dma_supported;
+extern ia64_mv_get_pcibus_nodemask_t sn_get_pcibus_nodemask;
/*
* This stuff has dual use!
@@ -116,6 +117,7 @@
#define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device
#define platform_dma_mapping_error sn_dma_mapping_error
#define platform_dma_supported sn_dma_supported
+#define platform_get_pcibus_nodemask sn_get_pcibus_nodemask
#include <asm/sn/sn2/io.h>
===== include/asm-ia64/topology.h 1.10 vs edited =====
--- 1.10/include/asm-ia64/topology.h 2004-02-03 21:35:17 -08:00
+++ edited/include/asm-ia64/topology.h 2004-07-30 08:38:17 -07:00
@@ -45,6 +45,9 @@
void build_cpu_to_node_map(void);
+#define ARCH_HAS_GET_PCIBUS_NODEMASK
+extern nodemask_t get_pcibus_nodemask(int bus);
+
#endif /* CONFIG_NUMA */
#include <asm-generic/topology.h>
next prev parent reply other threads:[~2004-07-30 15:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-27 0:10 [RFC][PATCH] Change pcibus_to_cpumask() to pcibus_to_node() Matthew Dobson
2004-07-27 3:38 ` Jesse Barnes
2004-07-27 9:51 ` [Lse-tech] " Christoph Hellwig
2004-07-27 15:22 ` Jesse Barnes
2004-07-27 18:32 ` Matthew Dobson
2004-07-27 18:40 ` Jesse Barnes
2004-07-29 0:06 ` Matthew Dobson
2004-07-29 15:43 ` Jesse Barnes
2004-07-29 22:23 ` Matthew Dobson
2004-07-30 15:36 ` Jesse Barnes [this message]
2004-07-30 22:17 ` Matthew Dobson
2004-07-30 22:21 ` Jesse Barnes
2004-07-30 22:33 ` Matthew Dobson
2004-07-29 17:02 ` Rajesh Shah
2004-07-29 22:27 ` Matthew Dobson
2004-07-30 0:02 ` Rajesh Shah
2004-07-28 15:01 ` Martin J. Bligh
2004-07-28 19:10 ` Matthew Dobson
2004-07-27 14:16 ` Andi Kleen
2004-07-27 15:15 ` Jesse Barnes
2004-07-27 15:57 ` Andi Kleen
2004-07-27 18:18 ` Matthew Dobson
2004-07-29 8:34 ` Paul Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200407300836.32812.jbarnes@engr.sgi.com \
--to=jbarnes@engr.sgi.com \
--cc=ak@suse.de \
--cc=colpatch@us.ibm.com \
--cc=hch@infradead.org \
--cc=jbarnes@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=mbligh@aracnet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.