Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3860736pxb; Tue, 17 Nov 2020 05:37:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxy2rMA9Skmav7FZ6cr5WbA3kX0FsILtQE9K+TwjizVIU9ZgU/YaqHIQW+rN/t0VPloD1wM X-Received: by 2002:aa7:c74e:: with SMTP id c14mr827242eds.202.1605620228776; Tue, 17 Nov 2020 05:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620228; cv=none; d=google.com; s=arc-20160816; b=RwBffsScQM2ZdQhAois0+C+FaW/N7y3qdWBEIr9y7tvZceVwgViotNQglsUlbCthlC w5RlSuGH5fiOpr3rtUYIMmk4E15qzALZpCKQhoNousiF5/DmnrxfI5yYYRyPqJLjcHRm qZuK66vrh6a4dxTeqMwCDpRE2nLI0wIYBLwpWHPJekM5RDotR/dG2ySui5YqPeFB5nDn rE+8Xdj8xWbuKxq3XD//Y95xzl24pfJlZ/H73so/u8Fhu8KBMbXMZhhvTb7Z5pk+mcfH F15HkDeHs7fK9sWEJiLLSMO3XhZ0uRJoCA2F9xeOvIM05e2xaKilQTf3Slw0X0dIU4TQ qofA== 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=isj8XR7P4DIlmaIMHqrIkDuIJhSMdLo8xRUclyOE2Fc=; b=0zURs/+1mXUuaYj+Jl3ovYblqDkIjNP6kiaoP74G8PP6JYntnU6XyGUMZgTiUnBOxM alykfs5iRPFKiMJW5wV8/Fl7NFRnvxOTSbxFiFYq3cZg0gdTUGXCIE9gZlpvtK8HTqXp Ytz5WSUKrDShECfC5dWrUZfM4hdsUDcer234GnLlZWvtFt2PcsUC46RoTKktGMX98CZw xQSDbniE97XeS92MKGvEEa0SHS31YxQ7Ibi+WrTucG3IRr/RNxZausb48aVc7ReYAJyf 9CwofCRlAuISkeynnQChomgd3qgm9F/3Ga9wL4STnInsg39wQNHqf92XiQr4YcaogmtD 29lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KNfNpvNu; 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=fail (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 c1si14427298edq.286.2020.11.17.05.36.45; Tue, 17 Nov 2020 05:37:08 -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=@kernel.org header.s=default header.b=KNfNpvNu; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732466AbgKQNf1 (ORCPT + 99 others); Tue, 17 Nov 2020 08:35:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:45932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732455AbgKQNfT (ORCPT ); Tue, 17 Nov 2020 08:35:19 -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 AF7BC2466D; Tue, 17 Nov 2020 13:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620119; bh=6DIxz/ib5e4NY8x17EduEG3JMHRG1WPKsMLGX1UO9Bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KNfNpvNup/pUy6OB6Wayy4WpzHtEKnTxdVZNzZZXFr8JTlsFYN+iDu483sWmlo7GR YG/E9uGGF2VZZ61tcQTMbDRsCIwaasDBrF/FapfSvp61cPRahqF+44VEKCHTZm3lzn azh2lIDNoAs/nI1uBIZPlTL+v6OullmABPT6ISo0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , "Paul E. McKenney" , Heiko Carstens , Sasha Levin Subject: [PATCH 5.9 113/255] s390/smp: move rcu_cpu_starting() earlier Date: Tue, 17 Nov 2020 14:04:13 +0100 Message-Id: <20201117122144.446679032@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@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: Qian Cai [ Upstream commit de5d9dae150ca1c1b5c7676711a9ca139d1a8dec ] The call to rcu_cpu_starting() in smp_init_secondary() is not early enough in the CPU-hotplug onlining process, which results in lockdep splats as follows: WARNING: suspicious RCU usage ----------------------------- kernel/locking/lockdep.c:3497 RCU-list traversed in non-reader section!! other info that might help us debug this: RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 no locks held by swapper/1/0. Call Trace: show_stack+0x158/0x1f0 dump_stack+0x1f2/0x238 __lock_acquire+0x2640/0x4dd0 lock_acquire+0x3a8/0xd08 _raw_spin_lock_irqsave+0xc0/0xf0 clockevents_register_device+0xa8/0x528 init_cpu_timer+0x33e/0x468 smp_init_secondary+0x11a/0x328 smp_start_secondary+0x82/0x88 This is avoided by moving the call to rcu_cpu_starting up near the beginning of the smp_init_secondary() function. Note that the raw_smp_processor_id() is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers. Link: https://lore.kernel.org/lkml/160223032121.7002.1269740091547117869.tip-bot2@tip-bot2/ Signed-off-by: Qian Cai Acked-by: Paul E. McKenney Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- arch/s390/kernel/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 85700bd85f98d..3b4c3140c18e7 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -855,13 +855,14 @@ void __init smp_detect_cpus(void) static void smp_init_secondary(void) { - int cpu = smp_processor_id(); + int cpu = raw_smp_processor_id(); S390_lowcore.last_update_clock = get_tod_clock(); restore_access_regs(S390_lowcore.access_regs_save_area); set_cpu_flag(CIF_ASCE_PRIMARY); set_cpu_flag(CIF_ASCE_SECONDARY); cpu_init(); + rcu_cpu_starting(cpu); preempt_disable(); init_cpu_timer(); vtime_init(); -- 2.27.0