The patch titled asm-generic: add node_to_cpumask_ptr macro has been added to the -mm tree. Its filename is asm-generic-add-node_to_cpumask_ptr-macro.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: asm-generic: add node_to_cpumask_ptr macro From: Mike Travis <travis@xxxxxxx> Create a simple macro to always return a pointer to the node_to_cpumask(node) value. This relies on compiler optimization to remove the extra indirection: #define node_to_cpumask_ptr(v, node) \ cpumask_t _##v = node_to_cpumask(node), *v = &_##v For those systems with a large cpumask size, then a true pointer to the array element can be used: #define node_to_cpumask_ptr(v, node) \ cpumask_t *v = &(node_to_cpumask_map[node]) A node_to_cpumask_ptr_next() macro is provided to access another node_to_cpumask value. The other change is to always include asm-generic/topology.h moving the ifdef CONFIG_NUMA to this same file. Note: there are no references to either of these new macros in this patch, only the definition. Cc: Richard Henderson <rth@xxxxxxxxxxx> Cc: David Howells <dhowells@xxxxxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: Paul Mackerras <paulus@xxxxxxxxx> Cc: Anton Blanchard <anton@xxxxxxxxx> Cc: David S. Miller <davem@xxxxxxxxxxxxx> Cc: William L. Irwin <wli@xxxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: H. Peter Anvin <hpa@xxxxxxxxx> Signed-off-by: Mike Travis <travis@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/asm-alpha/topology.h | 3 +-- include/asm-frv/topology.h | 4 +--- include/asm-generic/topology.h | 14 ++++++++++++++ include/asm-ia64/topology.h | 5 +++++ include/asm-powerpc/topology.h | 3 +-- include/asm-x86/topology.h | 15 +++++++++++++-- 6 files changed, 35 insertions(+), 9 deletions(-) diff -puN include/asm-alpha/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-alpha/topology.h --- a/include/asm-alpha/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-alpha/topology.h @@ -41,8 +41,7 @@ static inline cpumask_t node_to_cpumask( #define pcibus_to_cpumask(bus) (cpu_online_map) -#else /* CONFIG_NUMA */ -# include <asm-generic/topology.h> #endif /* !CONFIG_NUMA */ +# include <asm-generic/topology.h> #endif /* _ASM_ALPHA_TOPOLOGY_H */ diff -puN include/asm-frv/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-frv/topology.h --- a/include/asm-frv/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-frv/topology.h @@ -5,10 +5,8 @@ #error NUMA not supported yet -#else /* !CONFIG_NUMA */ +#endif /* CONFIG_NUMA */ #include <asm-generic/topology.h> -#endif /* CONFIG_NUMA */ - #endif /* _ASM_TOPOLOGY_H */ diff -puN include/asm-generic/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-generic/topology.h --- a/include/asm-generic/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-generic/topology.h @@ -27,6 +27,8 @@ #ifndef _ASM_GENERIC_TOPOLOGY_H #define _ASM_GENERIC_TOPOLOGY_H +#ifndef CONFIG_NUMA + /* Other architectures wishing to use this simple topology API should fill in the below functions as appropriate in their own <asm/topology.h> file. */ #ifndef cpu_to_node @@ -52,4 +54,16 @@ ) #endif +#endif /* CONFIG_NUMA */ + +/* returns pointer to cpumask for specified node */ +#ifndef node_to_cpumask_ptr + +#define node_to_cpumask_ptr(v, node) \ + cpumask_t _##v = node_to_cpumask(node), *v = &_##v + +#define node_to_cpumask_ptr_next(v, node) \ + _##v = node_to_cpumask(node) +#endif + #endif /* _ASM_GENERIC_TOPOLOGY_H */ diff -puN include/asm-ia64/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-ia64/topology.h --- a/include/asm-ia64/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-ia64/topology.h @@ -116,6 +116,11 @@ void build_cpu_to_node_map(void); #define smt_capable() (smp_num_siblings > 1) #endif +#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \ + CPU_MASK_ALL : \ + node_to_cpumask(pcibus_to_node(bus)) \ + ) + #include <asm-generic/topology.h> #endif /* _ASM_IA64_TOPOLOGY_H */ diff -puN include/asm-powerpc/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-powerpc/topology.h --- a/include/asm-powerpc/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-powerpc/topology.h @@ -96,11 +96,10 @@ static inline void sysfs_remove_device_f { } +#endif /* CONFIG_NUMA */ #include <asm-generic/topology.h> -#endif /* CONFIG_NUMA */ - #ifdef CONFIG_SMP #include <asm/cputable.h> #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) diff -puN include/asm-x86/topology.h~asm-generic-add-node_to_cpumask_ptr-macro include/asm-x86/topology.h --- a/include/asm-x86/topology.h~asm-generic-add-node_to_cpumask_ptr-macro +++ a/include/asm-x86/topology.h @@ -81,6 +81,17 @@ static inline int cpu_to_node(int cpu) else return NUMA_NO_NODE; } + +#ifdef CONFIG_NUMA + +/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ +#define node_to_cpumask_ptr(v, node) \ + cpumask_t *v = &(node_to_cpumask_map[node]) + +#define node_to_cpumask_ptr_next(v, node) \ + v = &(node_to_cpumask_map[node]) +#endif + #endif /* CONFIG_X86_64 */ /* @@ -167,10 +178,10 @@ extern int __node_distance(int, int); #else /* CONFIG_NUMA */ -#include <asm-generic/topology.h> - #endif +#include <asm-generic/topology.h> + extern cpumask_t cpu_coregroup_map(int cpu); #ifdef ENABLE_TOPO_DEFINES _ Patches currently in -mm which might be from travis@xxxxxxx are git-cpufreq.patch asm-generic-add-node_to_cpumask_ptr-macro.patch oprofile-change-cpu_buffer-from-array-to-per_cpu-variable.patch oprofile-change-cpu_buffer-from-array-to-per_cpu-variable-checkpatch-fixes.patch cpufreq-change-cpu-freq-arrays-to-per_cpu-variables.patch acpi-change-processors-from-array-to-per_cpu-variable.patch cpu-change-cpu_sys_devices-from-array-to-per_cpu-variable.patch net-remove-nr_cpus-arrays-in-net-core-devc-v2.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html