lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201106144312.GU3249@paulmck-ThinkPad-P72>
Date:   Fri, 6 Nov 2020 06:43:12 -0800
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Will Deacon <will@...nel.org>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kernel-team@...roid.com, Catalin Marinas <catalin.marinas@....com>,
        Qian Cai <cai@...hat.com>
Subject: Re: [PATCH 2/2] arm64: smp: Tell RCU about CPUs that fail to come
 online

On Fri, Nov 06, 2020 at 10:36:02AM +0000, Will Deacon wrote:
> Commit ce3d31ad3cac ("arm64/smp: Move rcu_cpu_starting() earlier") ensured
> that RCU is informed early about incoming CPUs that might end up calling
> into printk() before they are online. However, if such a CPU fails the
> early CPU feature compatibility checks in check_local_cpu_capabilities(),
> then it will be powered off or parked without informing RCU, leading to
> an endless stream of stalls:
> 
>   | rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
>   | rcu:	2-O...: (0 ticks this GP) idle=002/1/0x4000000000000000 softirq=0/0 fqs=2593
>   | (detected by 0, t=5252 jiffies, g=9317, q=136)
>   | Task dump for CPU 2:
>   | task:swapper/2       state:R  running task     stack:    0 pid:    0 ppid:     1 flags:0x00000028
>   | Call trace:
>   | ret_from_fork+0x0/0x30
> 
> Ensure that the dying CPU invokes rcu_report_dead() prior to being powered
> off or parked.
> 
> Cc: Qian Cai <cai@...hat.com>
> Cc: "Paul E. McKenney" <paulmck@...nel.org>
> Suggested-by: Qian Cai <cai@...hat.com>
> Signed-off-by: Will Deacon <will@...nel.org>

Reviewed-by: Paul E. McKenney <paulmck@...nel.org>

> ---
>  arch/arm64/kernel/smp.c | 1 +
>  kernel/rcu/tree.c       | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> index 09c96f57818c..18e9727d3f64 100644
> --- a/arch/arm64/kernel/smp.c
> +++ b/arch/arm64/kernel/smp.c
> @@ -413,6 +413,7 @@ void cpu_die_early(void)
>  
>  	/* Mark this CPU absent */
>  	set_cpu_present(cpu, 0);
> +	rcu_report_dead(cpu);
>  
>  	if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
>  		update_cpu_boot_status(CPU_KILL_ME);
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 2a52f42f64b6..bd04b09b84b3 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -4077,7 +4077,6 @@ void rcu_cpu_starting(unsigned int cpu)
>  	smp_mb(); /* Ensure RCU read-side usage follows above initialization. */
>  }
>  
> -#ifdef CONFIG_HOTPLUG_CPU
>  /*
>   * The outgoing function has no further need of RCU, so remove it from
>   * the rcu_node tree's ->qsmaskinitnext bit masks.
> @@ -4117,6 +4116,7 @@ void rcu_report_dead(unsigned int cpu)
>  	rdp->cpu_started = false;
>  }
>  
> +#ifdef CONFIG_HOTPLUG_CPU
>  /*
>   * The outgoing CPU has just passed through the dying-idle state, and we
>   * are being invoked from the CPU that was IPIed to continue the offline
> -- 
> 2.29.1.341.ge80a0c044ae-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ