linux-2.5.38-mm2 cleanups
Subsystems (2)
PATCH 1/1 linux-2.5.38-mm2 cleanups
Andrew,
Here are a couple of cleanups for the 2.5.38-mm2 tree.
Anton,
I cc'd you, because the patch also moves the __cpu_to_node() function
from mmzone.h into topology.h, where it really belongs (as long as the in-kernel topology stuff is there). If there's some reason that shouldn't be done, please yell at me! ;)
Changelog:
This patch cleans up a couple of braindamaged things I was doing with
<asm-generic/topology.h> and moves a ppc64 topology function from mmzone.h into topology.h.
Cheers!
-Matt
include/asm-alpha/topology.h +10 -3
@@ -4,11 +4,18 @@#ifdef CONFIG_NUMA #ifdef CONFIG_ALPHA_WILDFIRE /* With wildfire assume 4 CPUs per node */ -#define __cpu_to_node (cpu) ((cpu) >> 2) +#define __cpu_to_node (cpu) ((cpu) >> 2)#endif /* CONFIG_ALPHA_WILDFIRE */ #endif /* CONFIG_NUMA */ -/* Get the rest of the topology definitions */ -#include <asm-generic/topology.h> +#if !defined(CONFIG_NUMA ) || !defined(CONFIG_ALPHA_WILDFIRE ) +#define __cpu_to_node (cpu) (0) +#endif /* !CONFIG_NUMA || !CONFIG_ALPHA_WILDFIRE */ + +#define __memblk_to_node (memblk) (0) +#define __parent_node (nid) (0) +#define __node_to_first_cpu (node) (0) +#define __node_to_cpu_mask (node) (cpu_online_map) +#define __node_to_memblk (node) (0)#endif /* _ASM_ALPHA_TOPOLOGY_H */
include/asm-generic/topology.h +2 -2
@@ -33,7 +33,7 @@#define __cpu_to_node (cpu) (0)#endif #ifndef __memblk_to_node -#define __memblk_to_node (memblk) (0) +#define __memblk_to_node (memblk) (0)#endif #ifndef __parent_node#define __parent_node (nid) (0)
@@ -42,7 +42,7 @@#define __node_to_first_cpu (node) (0)#endif #ifndef __node_to_cpu_mask -#define __node_to_cpu_mask (node) (cpu_online_map) +#define __node_to_cpu_mask (node) (cpu_online_map)#endif #ifndef __node_to_memblk#define __node_to_memblk (node) (0)
include/asm-i386/mmzone.h +0 -3
@@ -14,9 +14,6 @@#include <asm/numaq.h> #else #define pfn_to_nid (pfn) (0) -#ifdef CONFIG_NUMA -#define _cpu_to_node (cpu) 0 -#endif /* CONFIG_NUMA */ #endif /* CONFIG_X86_NUMAQ */ extern struct pglist_data *node_data[];
include/asm-i386/numaq.h +0 -3
@@ -41,9 +41,6 @@#define pfn_to_pgdat (pfn) NODE_DATA(pfn_to_nid(pfn))#define PHYSADDR_TO_NID (pa) pfn_to_nid(pa >> PAGE_SHIFT)#define MAX_NUMNODES 8 -#ifdef CONFIG_NUMA -#define _cpu_to_node (cpu) (cpu_to_logical_apicid(cpu) >> 4) -#endif /* CONFIG_NUMA */ extern int pfn_to_nid (unsigned long );extern void get_memcfg_numaq (void );#define get_memcfg_numa () get_memcfg_numaq()
include/asm-mips64/topology.h +5 -3
@@ -4,8 +4,10 @@#include <asm/mmzone.h> #define __cpu_to_node (cpu) (cputocnode(cpu)) - -/* Get the rest of the topology definitions */ -#include <asm-generic/topology.h> +#define __memblk_to_node (memblk) (0) +#define __parent_node (nid) (0) +#define __node_to_first_cpu (node) (0) +#define __node_to_cpu_mask (node) (cpu_online_map) +#define __node_to_memblk (node) (0)#endif /* _ASM_MIPS64_TOPOLOGY_H */
include/asm-ppc64/mmzone.h +0 -18
@@ -56,24 +56,6 @@#define node_size (nid) (NODE_DATA(nid)->node_size)#define node_localnr (pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) -#ifdef CONFIG_NUMA - -static inline int __cpu_to_node (int cpu) -{ -int node; - - node = numa_cpu_lookup_table[cpu]; - -#ifdef DEBUG_NUMA -if (node ==-1 ) -BUG (); -#endif - -return node; -} - -#endif /* CONFIG_NUMA */ -/* * Following are macros that each numa implmentation must define. */
include/asm-ppc64/topology.h +24 -4
@@ -4,11 +4,31 @@#include <asm/mmzone.h> #ifdef CONFIG_NUMA -/* XXX grab this from the device tree - Anton */ -#define __cpu_to_node (cpu) ((cpu) >> CPU_SHIFT_BITS) + +static inline int __cpu_to_node (int cpu) +{ +int node; + + node = numa_cpu_lookup_table[cpu]; + +#ifdef DEBUG_NUMA +if (node ==-1 ) +BUG (); +#endif + +return node; +} + +#else /* !CONFIG_NUMA */ + +#define __cpu_to_node (cpu) (0) +#endif /* CONFIG_NUMA */ -/* Get the rest of the topology definitions */ -#include <asm-generic/topology.h> +#define __memblk_to_node (memblk) (0) +#define __parent_node (nid) (0) +#define __node_to_first_cpu (node) (0) +#define __node_to_cpu_mask (node) (cpu_online_map) +#define __node_to_memblk (node) (0)#endif /* _ASM_PPC64_TOPOLOGY_H */
Quoted 5 lines
I cc'd you, because the patch also moves the
__cpu_to_node()function frommmzone.hintotopology.h, where it really belongs (as long as the in-kernel topology stuff is there). If there's some reason that shouldn't be done, please yell at me! ;)
No problems from me :)
Anton