[PATCH 1/2] arm64: smp: Add function to determine if cpus are stuck in the kernel

Suzuki K Poulose Suzuki.Poulose at arm.com
Fri Jun 17 09:39:55 PDT 2016


On 17/06/16 17:37, Geoff Levand wrote:
> On Fri, 2016-06-17 at 10:34 +0100, James Morse wrote:
>> +bool cpus_are_stuck_in_kernel(void)
>> +{
>> +> 	> bool ret = !!cpus_stuck_in_kernel;
>> +#ifdef CONFIG_HOTPLUG_CPU
>
> How about using 'if (IS_ENABLED(CONFIG_HOTPLUG_CPU))' here?
>
>> +	int any_cpu = raw_smp_processor_id();
>> +
>> +> 	> if (num_possible_cpus() > 1 && !cpu_ops[any_cpu]->cpu_die)
>> +> 	> 	> ret = true;
>> +#endif
>

That won't work, as the cpu_ops->cpu_die is defined only if CONFIG_HOTPLUG_CPU.

May be we should fix that.

Suzuki



More information about the linux-arm-kernel mailing list