diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-04-29 18:08:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:36 -0400 |
commit | d8f10cb3d375c34ad668f32ca6e4661ad1fc23b2 (patch) | |
tree | 37e8289b0f5d28a8ca608c7ee3fac5b5bb8a0e15 /kernel/cpuset.c | |
parent | 3c743a7f7b682dedef188664514c0ea82e232742 (diff) |
kernel/cpuset.c: use register_hotmemory_notifier()
Use the new interface, remove one ifdef. No code size changes.
We could/should have been using __meminit/__meminitdata here but there's
now no point in doing that because all this code is elided at compile time.
Cc: Li Zefan <lizefan@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r-- | kernel/cpuset.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4f9dfe43ecbd..334d983a36b2 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -2251,7 +2251,6 @@ void cpuset_update_active_cpus(bool cpu_online) | |||
2251 | schedule_work(&cpuset_hotplug_work); | 2251 | schedule_work(&cpuset_hotplug_work); |
2252 | } | 2252 | } |
2253 | 2253 | ||
2254 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
2255 | /* | 2254 | /* |
2256 | * Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY]. | 2255 | * Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY]. |
2257 | * Call this routine anytime after node_states[N_MEMORY] changes. | 2256 | * Call this routine anytime after node_states[N_MEMORY] changes. |
@@ -2263,20 +2262,23 @@ static int cpuset_track_online_nodes(struct notifier_block *self, | |||
2263 | schedule_work(&cpuset_hotplug_work); | 2262 | schedule_work(&cpuset_hotplug_work); |
2264 | return NOTIFY_OK; | 2263 | return NOTIFY_OK; |
2265 | } | 2264 | } |
2266 | #endif | 2265 | |
2266 | static struct notifier_block cpuset_track_online_nodes_nb = { | ||
2267 | .notifier_call = cpuset_track_online_nodes, | ||
2268 | .priority = 10, /* ??! */ | ||
2269 | }; | ||
2267 | 2270 | ||
2268 | /** | 2271 | /** |
2269 | * cpuset_init_smp - initialize cpus_allowed | 2272 | * cpuset_init_smp - initialize cpus_allowed |
2270 | * | 2273 | * |
2271 | * Description: Finish top cpuset after cpu, node maps are initialized | 2274 | * Description: Finish top cpuset after cpu, node maps are initialized |
2272 | **/ | 2275 | */ |
2273 | |||
2274 | void __init cpuset_init_smp(void) | 2276 | void __init cpuset_init_smp(void) |
2275 | { | 2277 | { |
2276 | cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask); | 2278 | cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask); |
2277 | top_cpuset.mems_allowed = node_states[N_MEMORY]; | 2279 | top_cpuset.mems_allowed = node_states[N_MEMORY]; |
2278 | 2280 | ||
2279 | hotplug_memory_notifier(cpuset_track_online_nodes, 10); | 2281 | register_hotmemory_notifier(&cpuset_track_online_nodes_nb); |
2280 | 2282 | ||
2281 | cpuset_propagate_hotplug_wq = | 2283 | cpuset_propagate_hotplug_wq = |
2282 | alloc_ordered_workqueue("cpuset_hotplug", 0); | 2284 | alloc_ordered_workqueue("cpuset_hotplug", 0); |