Skip to content

Commit

Permalink
riscv: cpu-hotplug: clear cpu from numa map when teardown
Browse files Browse the repository at this point in the history
There is numa_add_cpu() when cpus online, accordingly, there should be
numa_remove_cpu() when cpus offline.

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Fixes: 4f0e8ee ("riscv: Add numa support for riscv64 platform")
Cc: stable@vger.kernel.org
[Palmer: Add missing NUMA include]
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
  • Loading branch information
liupingfan authored and palmer-dabbelt committed Feb 10, 2022
1 parent f81393a commit f40fe31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/riscv/kernel/cpu-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <linux/sched/hotplug.h>
#include <asm/irq.h>
#include <asm/cpu_ops.h>
#include <asm/numa.h>
#include <asm/sbi.h>

bool cpu_has_hotplug(unsigned int cpu)
Expand Down Expand Up @@ -40,6 +41,7 @@ int __cpu_disable(void)
return ret;

remove_cpu_topology(cpu);
numa_remove_cpu(cpu);
set_cpu_online(cpu, false);
irq_migrate_all_off_this_cpu();

Expand Down

0 comments on commit f40fe31

Please sign in to comment.