Re: [PATCH] RFC: console: hack up console_lock more v3

From: Sergey Senozhatsky
Date: Fri May 10 2019 - 05:53:05 EST


On (05/10/19 11:15), Petr Mladek wrote:
[..]
> arch/x86/kernel/smp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/arch/x86/kernel/smp.c
> +++ b/arch/x86/kernel/smp.c
> @@ -124,7 +124,8 @@ static bool smp_no_nmi_ipi = false;
> */
> static void native_smp_send_reschedule(int cpu)
> {
> - if (unlikely(cpu_is_offline(cpu))) {
> + if (unlikely(cpu_is_offline(cpu) &&
> + atomic_read(&stopping_cpu) < 0)) {
> WARN(1, "sched: Unexpected reschedule of offline CPU#%d!\n", cpu);
> return;
> }

I think we need to remove CPU which we IPI_STOP from
idle_cpus_mask. So then scheduler won't pick up stopped
CPUs (cpumask_first(nohz.idle_cpus_mask)) and attempt
rescheduling to them. It seems that currently
native_stop_other_cpus() doesn't do that.

-ss