Re: [patch 6/6] x86: cpumask_of_node() should handle -1 as a node

From: Rusty Russell
Date: Wed Jan 06 2010 - 19:39:24 EST


On Thu, 7 Jan 2010 10:21:06 am David Rientjes wrote:
> On Thu, 7 Jan 2010, Anton Blanchard wrote:
>
> > I don't like the use of -1 as a node, but it's much more widespread than
> > x86; including sh, powerpc, sparc and the generic topology code. eg:
> >
> >
> > #fdef CONFIG_PCI
> > extern int pcibus_to_node(struct pci_bus *pbus);
> > #else
> > static inline int pcibus_to_node(struct pci_bus *pbus)
> > {
> > return -1;
> > }
>
> This seems to be the same semantics that NUMA_NO_NODE was defined for,
> it's not necessarily a special case.

It's widespread, and we've just had another bug due to pcibus_to_node handling
-1 and cpumask_of_node not. (Search lkml for subject "[Regression] 2.6.33-rc2
- pci: Commit e0cd516 causes OOPS").

So I think the evidence is in favor of just handling -1.

Cheers,
Rusty.
--
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/