Re: [Lse-tech] [RFC][PATCH] Change pcibus_to_cpumask() topcibus_to_node()

From: Matthew Dobson
Date: Tue Jul 27 2004 - 13:35:20 EST


On Tue, 2004-07-27 at 08:22, Jesse Barnes wrote:
> On Tuesday, July 27, 2004 2:51 am, Christoph Hellwig wrote:
> > On Mon, Jul 26, 2004 at 05:10:08PM -0700, Matthew Dobson wrote:
> > > So in discussions with Jesse at OLS, we decided that pcibus_to_node() is
> >
> > Please do pcibus_to_nodemask() instead - there could be dual-ported pci
> > bridges.
>
> Do you know of any? On sn2 there are dual ported xio->pci bridges, but in
> that case, half the busses are associated with one node and the other half
> with another node, so pcibus_to_node would work in that case. And for
> numalink->pci bridges, we'll return the node id of the bridge in that case
> (which may not have any memory, but in that case alloc_pages_node will fall
> back to the next node).
>
> I wonder though if we shouldn't add
>
> ...
> #ifdef CONFIG_NUMA
> int node; /* or nodemask_t if necessary */
> #endif
> ...
>
> to struct pci_bus instead? That would make the existing code paths a little
> faster and avoid the need for a global array, which tends to lead to TLB
> misses.

I like that idea! Stick a nodemask_t in struct pci_bus, initialize it
to NODE_MASK_ALL. If a particular arch wants to put something more
accurate in there, then great, if not, we're just in the same boat we're
in now.

Anyone else have opinions one way or the other on Jesse's idea?

> Anyway, my needs are very simple. I'd like to do
> alloc_pages_node(pci_to_node(pci_dev)); in the sn2 version of
> pci_alloc_consistent and use the new routine to simplify the initial irq
> setup code, making it look more like build_zonelists and the sched domains
> patch I posted yesterday. So as long as those needs are provided for, I'm ok
> with the interface.
>
> Thanks,
> Jesse

I'm trying to keep the dependency of topology on what the pci_dev and
pci_bus structs look like to a minimum. That's why I'd like to keep the
topology function based on PCI bus numbers (or possibly struct pci_bus),
not struct pci_dev. The pci_bus is what really has the node affinity
anyway, and the device only has that affinity through the fact that it
is physically plugged into a particular bus.

-Matt

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/