diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-30 09:05:16 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-30 09:05:16 +1030 |
commit | 54b11e6d57a10aa9d0009efd93873e17bffd5d30 (patch) | |
tree | ac09296e7b0726aa6143913526f8983fae1cb497 /include | |
parent | 3fa41520696fec2815e2d88fbcccdda77ba4d693 (diff) | |
download | op-kernel-dev-54b11e6d57a10aa9d0009efd93873e17bffd5d30.zip op-kernel-dev-54b11e6d57a10aa9d0009efd93873e17bffd5d30.tar.gz |
cpumask: smp_call_function_many()
Impact: Implementation change to remove cpumask_t from stack.
Actually change smp_call_function_mask() to smp_call_function_many().
We avoid cpumasks on the stack in this version.
(S390 has its own version, but that's going away apparently).
We have to do some dancing to figure out if 0 or 1 other cpus are in
the mask supplied and the online mask without allocating a tmp
cpumask. It's still fairly cheap.
We allocate the cpumask at the end of the call_function_data
structure: if allocation fails we fallback to smp_call_function_single
rather than using the baroque quiescing code (which needs a cpumask on
stack).
(Thanks to Hiroshi Shimamoto for spotting several bugs in previous versions!)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: npiggin@suse.de
Cc: axboe@kernel.dk
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/smp.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h index 2f85f3b..b824669 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h @@ -67,15 +67,16 @@ extern void smp_cpus_done(unsigned int max_cpus); * Call a function on all other processors */ int smp_call_function(void(*func)(void *info), void *info, int wait); -/* Deprecated: use smp_call_function_many() which uses a cpumask ptr. */ -int smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, - int wait); +void smp_call_function_many(const struct cpumask *mask, + void (*func)(void *info), void *info, bool wait); -static inline void smp_call_function_many(const struct cpumask *mask, - void (*func)(void *info), void *info, - int wait) +/* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ +static inline int +smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, + int wait) { - smp_call_function_mask(*mask, func, info, wait); + smp_call_function_many(&mask, func, info, wait); + return 0; } int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, |