Skip to content

Commit

Permalink
x86/apic: Use dead_cpu instead of current CPU when cleaning up
Browse files Browse the repository at this point in the history
x2apic_dead_cpu() cleans up the leftovers of a CPU which got unplugged, but
instead of clearing the dead cpu bit in the cluster mask it clears the
current (alive) cpu bit. Noticed because smp_processor_id() is called in
preemptible code and triggers a debug warning.

[ tglx: Rewrote changelog ]

Fixes: 023a611 ("x86/apic/x2apic: Simplify cluster management")
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
suryasaimadhu authored and KAGA-KOKO committed Sep 27, 2017
1 parent 9c71206 commit 1e66e2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/apic/x2apic_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static int x2apic_dead_cpu(unsigned int dead_cpu)
{
struct cluster_mask *cmsk = per_cpu(cluster_masks, dead_cpu);

cpumask_clear_cpu(smp_processor_id(), &cmsk->mask);
cpumask_clear_cpu(dead_cpu, &cmsk->mask);
free_cpumask_var(per_cpu(ipi_mask, dead_cpu));
return 0;
}
Expand Down

0 comments on commit 1e66e2b

Please sign in to comment.