[lkml]   [2010]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch 6/6] x86: cpumask_of_node() should handle -1 as a node
On Wed, 6 Jan 2010, Rusty Russell wrote:

> > pcibus_to_node can return -1 if we cannot determine which node a pci bus
> > is on. If passed -1, cpumask_of_node will negatively index the lookup array
> > and pull in random data:
> If you grep for the callers, you'll see those which do this (now-obsolete)
> check. One more patch :)

Do we really want to do this? A nid of -1 is undefined, so the result of
cpumask_of_node(-1) should be undefined; there's no formal definition that
a nid of -1 follows the semantics that we use for x86 pci buses, for
example, where it implies no NUMA locality in all cases.

I think a better fix would be to define -1 where appropriate to either be
an invalid node, cpu_all_mask, or whatever in the caller:

mask = (nid != -1) ? cpumask_of_node(nid) : cpu_all_mask;

 \ /
  Last update: 2010-01-07 00:03    [W:0.088 / U:6.452 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site