Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238762pxu; Mon, 23 Nov 2020 15:37:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqAiI1+Zh/YK6HDNdLTuF55kbRr1AM5u4XkSgqcHvXR2Lw/SDVQAn6cXM+Iyba75zTyAzj X-Received: by 2002:aa7:d34e:: with SMTP id m14mr1538305edr.42.1606174647883; Mon, 23 Nov 2020 15:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174647; cv=none; d=google.com; s=arc-20160816; b=nF/wyi84RHl6yu9emhFrdTer5fMZs2okhV5IbGU5jHXTdHIMswnSUAKkPvPA99hPEx rvNSfHxZp18sY/rJ0x5HXKXcHVEpYz62b1SZ+CIme5y6wlLGQ/xWy6bFVYXPaRWVb24U dTgwxNMJL3ufxUt2k0tvtoicTzqJ6bwEtzoauUUuF89iVOrL5MHXyGtUfZAUce37A9JF wSR261BM84gBZNWe2Fw0NQLkbULQdktS8V1EWi9YhvCf7uCiR3W56Y1OpUemS6l8N5j+ NG0/lYxH1ILwLGHKT79Tdw9udpgR3MNvyKqiybqo2YjoBoJkK31UIzqeArh39Nd5AEZY Y/oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DOaFGuZFBwgHbxE1xmA0bIBGkfauXWzk9ke5tB/+hWY=; b=BM3wy0uxV5vop8g2mLdQK/pwGEY6WVV4vT3pK2JWUbwynfsv7vg7wZ+FPE3qtg1wRs lQ904W6PK9U63SnXo4ZQzKm2i9Py0oeZ1pJcT3IT2faH5jy8Bd1oHsJivtbxslgubnCy MynWBBnoJ+BzMsHoPBEsquAqRS/1E+ptCK/e3SuIGIOZsjLgx9n/v5hhebFd2zQ6Yw/f 7rK2fvmCGJidrqO8h9E0rCWHdfQLzisl6LYef4f+HjlpjNhoJ901EEUS2h3yo7ZJkHGE k0U4SGPRUfXgMAf67L65muOiSzlxJ2U/B/b+9bC5JdgVzoeR0Dygf2nreLRqzaNnOU3h 3ikA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wEu6a8ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si8742264eda.496.2020.11.23.15.37.05; Mon, 23 Nov 2020 15:37:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wEu6a8ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731512AbgKWMfW (ORCPT + 99 others); Mon, 23 Nov 2020 07:35:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:47274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731505AbgKWMfU (ORCPT ); Mon, 23 Nov 2020 07:35:20 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C7C6208C3; Mon, 23 Nov 2020 12:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134919; bh=sYI2T2mP9B1Ot0n51Un7gJWDZFLGvU+/Whru9pS96WI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wEu6a8ZAl2gyRCr6n2TRqw2i/9486w45MAgtSmrNDe7N2Z5KDXI+4o2uT2reX4LV/ N2b+ji5miX0jA4CBJjbc9dWU42lrvJxpvkDFhGQUvMaGJUKZC5TjWnhhhuf48LZcBX F/1CCn1d9rGVwGJ2pDmL4K1zwkrx2q61NyystU08= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , "Paul E. McKenney" , Will Deacon , Sasha Levin Subject: [PATCH 5.4 040/158] arm64: smp: Tell RCU about CPUs that fail to come online Date: Mon, 23 Nov 2020 13:21:08 +0100 Message-Id: <20201123121821.867955410@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit 04e613ded8c26489b3e0f9101b44462f780d1a35 ] 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 Cc: "Paul E. McKenney" Reviewed-by: Paul E. McKenney Suggested-by: Qian Cai Link: https://lore.kernel.org/r/20201105222242.GA8842@willie-the-truck Link: https://lore.kernel.org/r/20201106103602.9849-3-will@kernel.org Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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 426409e0d0713..987220ac4cfef 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -388,6 +388,7 @@ void cpu_die_early(void) /* Mark this CPU absent */ set_cpu_present(cpu, 0); + rcu_report_dead(cpu); #ifdef CONFIG_HOTPLUG_CPU update_cpu_boot_status(CPU_KILL_ME); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 62e59596a30a0..1b1d2b09efa9b 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3157,7 +3157,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. @@ -3197,6 +3196,7 @@ void rcu_report_dead(unsigned int cpu) per_cpu(rcu_cpu_started, cpu) = 0; } +#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.27.0