Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32938
b: refs/heads/master
c: 7c7165c
h: refs/heads/master
v: v3
  • Loading branch information
Chandra Seetharaman authored and Linus Torvalds committed Jul 31, 2006
1 parent 8598585 commit 0ec83a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c78f3075dab4be279e283f901f00e33ce44890a
refs/heads/master: 7c7165c90801609b70492e50b2a9c69a677c573a
12 changes: 10 additions & 2 deletions trunk/Documentation/cpu-hotplug.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,24 @@ A: This is what you would need in your kernel code to receive notifications.
return NOTIFY_OK;
}

static struct notifier_block foobar_cpu_notifer =
static struct notifier_block __cpuinitdata foobar_cpu_notifer =
{
.notifier_call = foobar_cpu_callback,
};

You need to call register_cpu_notifier() from your init function.
Init functions could be of two types:
1. early init (init function called when only the boot processor is online).
2. late init (init function called _after_ all the CPUs are online).

In your init function,
For the first case, you should add the following to your init function

register_cpu_notifier(&foobar_cpu_notifier);

For the second case, you should add the following to your init function

register_hotcpu_notifier(&foobar_cpu_notifier);

You can fail PREPARE notifiers if something doesn't work to prepare resources.
This will stop the activity and send a following CANCELED event back.

Expand Down

0 comments on commit 0ec83a9

Please sign in to comment.