diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2006-07-30 06:03:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:39 -0400 |
commit | 7c7165c90801609b70492e50b2a9c69a677c573a (patch) | |
tree | 59e1f38d0cab4f0fa57b6b6cbd196417d5333e7f /Documentation | |
parent | 8c78f3075dab4be279e283f901f00e33ce44890a (diff) |
[PATCH] cpu hotplug: fix hotplug cpu documentation for proper usage
Update hotplug cpu documentation to clearly state when to use
register_cpu_notifier() and register_hotcpu_notifier.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/cpu-hotplug.txt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index 1bcf69996c9d..bc107cb157a8 100644 --- a/Documentation/cpu-hotplug.txt +++ b/Documentation/cpu-hotplug.txt | |||
@@ -251,16 +251,24 @@ A: This is what you would need in your kernel code to receive notifications. | |||
251 | return NOTIFY_OK; | 251 | return NOTIFY_OK; |
252 | } | 252 | } |
253 | 253 | ||
254 | static struct notifier_block foobar_cpu_notifer = | 254 | static struct notifier_block __cpuinitdata foobar_cpu_notifer = |
255 | { | 255 | { |
256 | .notifier_call = foobar_cpu_callback, | 256 | .notifier_call = foobar_cpu_callback, |
257 | }; | 257 | }; |
258 | 258 | ||
259 | You need to call register_cpu_notifier() from your init function. | ||
260 | Init functions could be of two types: | ||
261 | 1. early init (init function called when only the boot processor is online). | ||
262 | 2. late init (init function called _after_ all the CPUs are online). | ||
259 | 263 | ||
260 | In your init function, | 264 | For the first case, you should add the following to your init function |
261 | 265 | ||
262 | register_cpu_notifier(&foobar_cpu_notifier); | 266 | register_cpu_notifier(&foobar_cpu_notifier); |
263 | 267 | ||
268 | For the second case, you should add the following to your init function | ||
269 | |||
270 | register_hotcpu_notifier(&foobar_cpu_notifier); | ||
271 | |||
264 | You can fail PREPARE notifiers if something doesn't work to prepare resources. | 272 | You can fail PREPARE notifiers if something doesn't work to prepare resources. |
265 | This will stop the activity and send a following CANCELED event back. | 273 | This will stop the activity and send a following CANCELED event back. |
266 | 274 | ||