diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:14 -0500 |
|---|---|---|
| committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:35:14 -0500 |
| commit | b3199c025d1646e25e7d1d640dd605db251dccf8 (patch) | |
| tree | 752bd257f2db6b4d39bf9cdce18ca25ade5e63a9 /kernel | |
| parent | cb78a0ce69fad2026825f957e24e2d9cda1ec9f1 (diff) | |
cpumask: switch over to cpu_online/possible/active/present_mask: core
Impact: cleanup
This implements the obsolescent cpu_online_map in terms of
cpu_online_mask, rather than the other way around. Same for the other
maps.
The documentation comments are also updated to refer to _mask rather
than _map.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cpu.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index bae131a1211b..3ddc509b19c5 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
| @@ -15,30 +15,8 @@ | |||
| 15 | #include <linux/stop_machine.h> | 15 | #include <linux/stop_machine.h> |
| 16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| 17 | 17 | ||
| 18 | /* | ||
| 19 | * Represents all cpu's present in the system | ||
| 20 | * In systems capable of hotplug, this map could dynamically grow | ||
| 21 | * as new cpu's are detected in the system via any platform specific | ||
| 22 | * method, such as ACPI for e.g. | ||
| 23 | */ | ||
| 24 | cpumask_t cpu_present_map __read_mostly; | ||
| 25 | EXPORT_SYMBOL(cpu_present_map); | ||
| 26 | |||
| 27 | /* | ||
| 28 | * Represents all cpu's that are currently online. | ||
| 29 | */ | ||
| 30 | cpumask_t cpu_online_map __read_mostly; | ||
| 31 | EXPORT_SYMBOL(cpu_online_map); | ||
| 32 | |||
| 33 | #ifdef CONFIG_INIT_ALL_POSSIBLE | ||
| 34 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; | ||
| 35 | #else | ||
| 36 | cpumask_t cpu_possible_map __read_mostly; | ||
| 37 | #endif | ||
| 38 | EXPORT_SYMBOL(cpu_possible_map); | ||
| 39 | |||
| 40 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
| 41 | /* Serializes the updates to cpu_online_map, cpu_present_map */ | 19 | /* Serializes the updates to cpu_online_mask, cpu_present_mask */ |
| 42 | static DEFINE_MUTEX(cpu_add_remove_lock); | 20 | static DEFINE_MUTEX(cpu_add_remove_lock); |
| 43 | 21 | ||
| 44 | static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); | 22 | static __cpuinitdata RAW_NOTIFIER_HEAD(cpu_chain); |
| @@ -65,8 +43,6 @@ void __init cpu_hotplug_init(void) | |||
| 65 | cpu_hotplug.refcount = 0; | 43 | cpu_hotplug.refcount = 0; |
| 66 | } | 44 | } |
| 67 | 45 | ||
| 68 | cpumask_t cpu_active_map; | ||
| 69 | |||
| 70 | #ifdef CONFIG_HOTPLUG_CPU | 46 | #ifdef CONFIG_HOTPLUG_CPU |
| 71 | 47 | ||
| 72 | void get_online_cpus(void) | 48 | void get_online_cpus(void) |
| @@ -97,7 +73,7 @@ EXPORT_SYMBOL_GPL(put_online_cpus); | |||
| 97 | 73 | ||
| 98 | /* | 74 | /* |
| 99 | * The following two API's must be used when attempting | 75 | * The following two API's must be used when attempting |
| 100 | * to serialize the updates to cpu_online_map, cpu_present_map. | 76 | * to serialize the updates to cpu_online_mask, cpu_present_mask. |
| 101 | */ | 77 | */ |
| 102 | void cpu_maps_update_begin(void) | 78 | void cpu_maps_update_begin(void) |
| 103 | { | 79 | { |
| @@ -503,3 +479,24 @@ EXPORT_SYMBOL_GPL(cpu_bit_bitmap); | |||
| 503 | 479 | ||
| 504 | const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL; | 480 | const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL; |
| 505 | EXPORT_SYMBOL(cpu_all_bits); | 481 | EXPORT_SYMBOL(cpu_all_bits); |
| 482 | |||
| 483 | #ifdef CONFIG_INIT_ALL_POSSIBLE | ||
| 484 | static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly | ||
| 485 | = CPU_BITS_ALL; | ||
| 486 | #else | ||
| 487 | static DECLARE_BITMAP(cpu_possible_bits, CONFIG_NR_CPUS) __read_mostly; | ||
| 488 | #endif | ||
| 489 | const struct cpumask *const cpu_possible_mask = to_cpumask(cpu_possible_bits); | ||
| 490 | EXPORT_SYMBOL(cpu_possible_mask); | ||
| 491 | |||
| 492 | static DECLARE_BITMAP(cpu_online_bits, CONFIG_NR_CPUS) __read_mostly; | ||
| 493 | const struct cpumask *const cpu_online_mask = to_cpumask(cpu_online_bits); | ||
| 494 | EXPORT_SYMBOL(cpu_online_mask); | ||
| 495 | |||
| 496 | static DECLARE_BITMAP(cpu_present_bits, CONFIG_NR_CPUS) __read_mostly; | ||
| 497 | const struct cpumask *const cpu_present_mask = to_cpumask(cpu_present_bits); | ||
| 498 | EXPORT_SYMBOL(cpu_present_mask); | ||
| 499 | |||
| 500 | static DECLARE_BITMAP(cpu_active_bits, CONFIG_NR_CPUS) __read_mostly; | ||
| 501 | const struct cpumask *const cpu_active_mask = to_cpumask(cpu_active_bits); | ||
| 502 | EXPORT_SYMBOL(cpu_active_mask); | ||
