Skip to content

Commit

Permalink
cpumask: use set_cpu_active in init/main.c
Browse files Browse the repository at this point in the history
cpu_active_map is deprecated in favor of cpu_active_mask, which is
const for safety: we use accessors now (set_cpu_active) is we really
want to make a change.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Mar 30, 2009
1 parent 0451fb2 commit 2b17fa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ static void __init smp_init(void)
* Set up the current CPU as possible to migrate to.
* The other ones will be done by cpu_up/cpu_down()
*/
cpu = smp_processor_id();
cpu_set(cpu, cpu_active_map);
set_cpu_active(smp_processor_id(), true);

/* FIXME: This should be done in userspace --RR */
for_each_present_cpu(cpu) {
Expand Down
6 changes: 3 additions & 3 deletions kernel/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ int __ref cpu_down(unsigned int cpu)
goto out;
}

cpu_clear(cpu, cpu_active_map);
set_cpu_active(cpu, false);

/*
* Make sure the all cpus did the reschedule and are not
Expand All @@ -296,7 +296,7 @@ int __ref cpu_down(unsigned int cpu)
err = _cpu_down(cpu, 0);

if (cpu_online(cpu))
cpu_set(cpu, cpu_active_map);
set_cpu_active(cpu, true);

out:
cpu_maps_update_done();
Expand Down Expand Up @@ -333,7 +333,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
goto out_notify;
BUG_ON(!cpu_online(cpu));

cpu_set(cpu, cpu_active_map);
set_cpu_active(cpu, true);

/* Now call notifier in preparation. */
raw_notifier_call_chain(&cpu_chain, CPU_ONLINE | mod, hcpu);
Expand Down

0 comments on commit 2b17fa5

Please sign in to comment.