aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cpu-hotplug.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/cpu-hotplug.txt')
-rw-r--r--Documentation/cpu-hotplug.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt
index a20bfd415e41..66ef8f35613d 100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
@@ -47,7 +47,7 @@ maxcpus=n Restrict boot time cpus to n. Say if you have 4 cpus, using
47 other cpus later online, read FAQ's for more info. 47 other cpus later online, read FAQ's for more info.
48 48
49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets 49additional_cpus=n (*) Use this to limit hotpluggable cpus. This option sets
50 cpu_possible_map = cpu_present_map + additional_cpus 50 cpu_possible_mask = cpu_present_mask + additional_cpus
51 51
52cede_offline={"off","on"} Use this option to disable/enable putting offlined 52cede_offline={"off","on"} Use this option to disable/enable putting offlined
53 processors to an extended H_CEDE state on 53 processors to an extended H_CEDE state on
@@ -64,11 +64,11 @@ should only rely on this to count the # of cpus, but *MUST* not rely
64on the apicid values in those tables for disabled apics. In the event 64on the apicid values in those tables for disabled apics. In the event
65BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could 65BIOS doesn't mark such hot-pluggable cpus as disabled entries, one could
66use this parameter "additional_cpus=x" to represent those cpus in the 66use this parameter "additional_cpus=x" to represent those cpus in the
67cpu_possible_map. 67cpu_possible_mask.
68 68
69possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus. 69possible_cpus=n [s390,x86_64] use this to set hotpluggable cpus.
70 This option sets possible_cpus bits in 70 This option sets possible_cpus bits in
71 cpu_possible_map. Thus keeping the numbers of bits set 71 cpu_possible_mask. Thus keeping the numbers of bits set
72 constant even if the machine gets rebooted. 72 constant even if the machine gets rebooted.
73 73
74CPU maps and such 74CPU maps and such
@@ -76,7 +76,7 @@ CPU maps and such
76[More on cpumaps and primitive to manipulate, please check 76[More on cpumaps and primitive to manipulate, please check
77include/linux/cpumask.h that has more descriptive text.] 77include/linux/cpumask.h that has more descriptive text.]
78 78
79cpu_possible_map: Bitmap of possible CPUs that can ever be available in the 79cpu_possible_mask: Bitmap of possible CPUs that can ever be available in the
80system. This is used to allocate some boot time memory for per_cpu variables 80system. This is used to allocate some boot time memory for per_cpu variables
81that aren't designed to grow/shrink as CPUs are made available or removed. 81that aren't designed to grow/shrink as CPUs are made available or removed.
82Once set during boot time discovery phase, the map is static, i.e no bits 82Once set during boot time discovery phase, the map is static, i.e no bits
@@ -84,13 +84,13 @@ are added or removed anytime. Trimming it accurately for your system needs
84upfront can save some boot time memory. See below for how we use heuristics 84upfront can save some boot time memory. See below for how we use heuristics
85in x86_64 case to keep this under check. 85in x86_64 case to keep this under check.
86 86
87cpu_online_map: Bitmap of all CPUs currently online. Its set in __cpu_up() 87cpu_online_mask: Bitmap of all CPUs currently online. Its set in __cpu_up()
88after a cpu is available for kernel scheduling and ready to receive 88after a cpu is available for kernel scheduling and ready to receive
89interrupts from devices. Its cleared when a cpu is brought down using 89interrupts from devices. Its cleared when a cpu is brought down using
90__cpu_disable(), before which all OS services including interrupts are 90__cpu_disable(), before which all OS services including interrupts are
91migrated to another target CPU. 91migrated to another target CPU.
92 92
93cpu_present_map: Bitmap of CPUs currently present in the system. Not all 93cpu_present_mask: Bitmap of CPUs currently present in the system. Not all
94of them may be online. When physical hotplug is processed by the relevant 94of them may be online. When physical hotplug is processed by the relevant
95subsystem (e.g ACPI) can change and new bit either be added or removed 95subsystem (e.g ACPI) can change and new bit either be added or removed
96from the map depending on the event is hot-add/hot-remove. There are currently 96from the map depending on the event is hot-add/hot-remove. There are currently
@@ -99,22 +99,22 @@ at which time hotplug is disabled.
99 99
100You really dont need to manipulate any of the system cpu maps. They should 100You really dont need to manipulate any of the system cpu maps. They should
101be read-only for most use. When setting up per-cpu resources almost always use 101be read-only for most use. When setting up per-cpu resources almost always use
102cpu_possible_map/for_each_possible_cpu() to iterate. 102cpu_possible_mask/for_each_possible_cpu() to iterate.
103 103
104Never use anything other than cpumask_t to represent bitmap of CPUs. 104Never use anything other than cpumask_t to represent bitmap of CPUs.
105 105
106 #include <linux/cpumask.h> 106 #include <linux/cpumask.h>
107 107
108 for_each_possible_cpu - Iterate over cpu_possible_map 108 for_each_possible_cpu - Iterate over cpu_possible_mask
109 for_each_online_cpu - Iterate over cpu_online_map 109 for_each_online_cpu - Iterate over cpu_online_mask
110 for_each_present_cpu - Iterate over cpu_present_map 110 for_each_present_cpu - Iterate over cpu_present_mask
111 for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask. 111 for_each_cpu_mask(x,mask) - Iterate over some random collection of cpu mask.
112 112
113 #include <linux/cpu.h> 113 #include <linux/cpu.h>
114 get_online_cpus() and put_online_cpus(): 114 get_online_cpus() and put_online_cpus():
115 115
116The above calls are used to inhibit cpu hotplug operations. While the 116The above calls are used to inhibit cpu hotplug operations. While the
117cpu_hotplug.refcount is non zero, the cpu_online_map will not change. 117cpu_hotplug.refcount is non zero, the cpu_online_mask will not change.
118If you merely need to avoid cpus going away, you could also use 118If you merely need to avoid cpus going away, you could also use
119preempt_disable() and preempt_enable() for those sections. 119preempt_disable() and preempt_enable() for those sections.
120Just remember the critical section cannot call any 120Just remember the critical section cannot call any