cpuhotplug: reject core0 offline by default
Core 0 of some server models with ARM architecture cannot be taken offline, so it is rejected by default. Signed-off-by: Chun Liu <kaicliu@tencent.com> Reviewed-by: Bin Lai <robinlai@tencent.com>
This commit is contained in:
parent
8769f0840e
commit
48bc119a5a
20
kernel/cpu.c
20
kernel/cpu.c
|
@ -39,6 +39,17 @@
|
|||
|
||||
#include "smpboot.h"
|
||||
|
||||
#ifdef CONFIG_ARM64
|
||||
static int cpu0_downable;
|
||||
static int __init enable_cpu0_offline(char *str)
|
||||
{
|
||||
cpu0_downable = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("cpu0_can_offline", enable_cpu0_offline);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cpuhp_cpu_state - Per cpu hotplug state storage
|
||||
* @state: The current cpu state
|
||||
|
@ -1005,6 +1016,15 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
|
|||
if (!cpu_present(cpu))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Core 0 of some server models with ARM architecture cannot be taken
|
||||
* offline, so it is rejected by default(ARM).
|
||||
*/
|
||||
#ifdef CONFIG_ARM64
|
||||
if (cpu == 0 && !cpu0_downable)
|
||||
return -EINVAL;
|
||||
#endif
|
||||
|
||||
cpus_write_lock();
|
||||
|
||||
cpuhp_tasks_frozen = tasks_frozen;
|
||||
|
|
Loading…
Reference in New Issue