lkml.org 
[lkml]   [2005]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: NUMA aware slab allocator V3
From
Date
> +#ifdef CONFIG_NUMA
> +#define NUMA_NODES MAX_NUMNODES
> +#define NUMA_NODE_ID numa_node_id()
> +#else
> +#define NUMA_NODES 1
> +#define NUMA_NODE_ID 0
> #endif

I think numa_node_id() should always do what you want. It is never
related to discontig nodes, and #defines down to the same thing you have
in the end, anyway:

#define numa_node_id() (cpu_to_node(_smp_processor_id()))

asm-i386/topology.h
#ifdef CONFIG_NUMA
...
static inline int cpu_to_node(int cpu)
{
return cpu_2_node[cpu];
}

asm-generic/topology.h:
#ifndef cpu_to_node
#define cpu_to_node(cpu) (0)
#endif

As for the MAX_NUMNODES, I'd just continue to use it, instead of a new
#define. There is no case where there can be more NUMA nodes than
DISCONTIG nodes, and this assumption appears in plenty of other code.

I'm cc'ing Matt Dobson, who's touched this MAX_NUMNODES business a lot
more recently than I.

-- Dave

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

\
 
 \ /
  Last update: 2005-05-17 02:31    [W:1.505 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site