Skip to content

Commit

Permalink
kernel/cpuset.c: use register_hotmemory_notifier()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
akpm00 authored and torvalds committed Apr 29, 2013
1 parent 3c743a7 commit d8f10cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2251,7 +2251,6 @@ void cpuset_update_active_cpus(bool cpu_online)
schedule_work(&cpuset_hotplug_work);
}

#ifdef CONFIG_MEMORY_HOTPLUG
/*
* Keep top_cpuset.mems_allowed tracking node_states[N_MEMORY].
* Call this routine anytime after node_states[N_MEMORY] changes.
Expand All @@ -2263,20 +2262,23 @@ static int cpuset_track_online_nodes(struct notifier_block *self,
schedule_work(&cpuset_hotplug_work);
return NOTIFY_OK;
}
#endif

static struct notifier_block cpuset_track_online_nodes_nb = {
.notifier_call = cpuset_track_online_nodes,
.priority = 10, /* ??! */
};

/**
* cpuset_init_smp - initialize cpus_allowed
*
* Description: Finish top cpuset after cpu, node maps are initialized
**/

*/
void __init cpuset_init_smp(void)
{
cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask);
top_cpuset.mems_allowed = node_states[N_MEMORY];

hotplug_memory_notifier(cpuset_track_online_nodes, 10);
register_hotmemory_notifier(&cpuset_track_online_nodes_nb);

cpuset_propagate_hotplug_wq =
alloc_ordered_workqueue("cpuset_hotplug", 0);
Expand Down

0 comments on commit d8f10cb

Please sign in to comment.