diff options
author | Jan Beulich <jbeulich@suse.com> | 2011-10-21 09:21:09 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2011-10-21 09:21:09 +0200 |
commit | 4f3e36d7ad7cd23f8df44e39fb14313a8a809e3d (patch) | |
tree | 495538ea99a0b2c90eb6f18c87fd48fab2f4ec3e /xen/common/stop_machine.c | |
parent | 3cfbbfcf4cb1d4fecfd1c9a8bab090bdb61e993e (diff) | |
download | xen-4f3e36d7ad7cd23f8df44e39fb14313a8a809e3d.tar.gz xen-4f3e36d7ad7cd23f8df44e39fb14313a8a809e3d.tar.bz2 xen-4f3e36d7ad7cd23f8df44e39fb14313a8a809e3d.zip |
eliminate direct assignments of CPU masks
Use cpumask_copy() instead of direct variable assignments for copying
CPU masks. While direct assignments are not a problem when both sides
are variables actually defined as cpumask_t (except for possibly
copying *much* more than would actually need to be copied), they must
not happen when the original variable is of type cpumask_var_t (which
may have lass space allocated to it than a full cpumask_t). Eliminate
as many of such assignments as possible (in several cases it's even
possible to collapse two operations [copy then clear one bit] into one
[cpumask_andnot()]), and thus set the way for reducing the allocation
size in alloc_cpumask_var().
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/stop_machine.c')
-rw-r--r-- | xen/common/stop_machine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/stop_machine.c b/xen/common/stop_machine.c index 9bf271452d..eb38da58f8 100644 --- a/xen/common/stop_machine.c +++ b/xen/common/stop_machine.c @@ -81,9 +81,9 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu) if ( !get_cpu_maps() ) return -EBUSY; - allbutself = cpu_online_map; - cpu_clear(smp_processor_id(), allbutself); - nr_cpus = cpus_weight(allbutself); + cpumask_andnot(&allbutself, &cpu_online_map, + cpumask_of(smp_processor_id())); + nr_cpus = cpumask_weight(&allbutself); /* Must not spin here as the holder will expect us to be descheduled. */ if ( !spin_trylock(&stopmachine_lock) ) |