Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26515420rwd; Mon, 3 Jul 2023 10:43:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7y1hSasQV6z7FIAHeKD47iUqKhF4lOr/Y6Z0bTrvccg5QZTwM5eabiHRDBniKMM8udx38P X-Received: by 2002:a05:6808:8c8:b0:3a1:ead3:bf20 with SMTP id k8-20020a05680808c800b003a1ead3bf20mr9768419oij.33.1688406193557; Mon, 03 Jul 2023 10:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688406193; cv=none; d=google.com; s=arc-20160816; b=D2fpQW3aRPYZ06pNjw10AJKDk0smhQT5gOr8v3EY1KIJvndJh6kH7bTAR/cTEgE8wi SjgI0usD2MgFpqnxHBflv6QCVnT/VUkEDdcmuqUKkVe4/4S9HyAS8lpDNfWJLj5S1la0 AcfeEFTvDqYEaq8qVviYx5ZERgNubDgfWpsdo3AgQOf3t6UO/ODNgUBPS1Ir+YXvuCQb Sx+q1Ph4dTU9W8w0MBhdkZSvjJ24Z3MGH2udvn8Zd17Xzu/opGMtmyVngPv+TlYPub1Y mnCgtfDOmWL34CITdWldEIsXDamgK/ukff9MjGzAOKbNiBA+u7Aw+P0G09wXcGellGY4 S4DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pJBVUBXBU/C0y+UxcAdeYvhfx2Sp5jOsaEMbcAsBYlY=; fh=RIQG8dgU4UQd510ZjHOEcVy666T+XMOjwth8CiGfpVY=; b=BclAusJTWRWLeYfcfmbczPxgsPSRcc5MTIAWdTxfeLFWu9QTcy7IFPtYv30M65zpyB npNlQ9+zYbvcAxRK44rq2Qpb7CM5rd6ELtyDrLrVfMdX5uJvrct53eaTQJ4VG+pCAcBB OYgWE/eylpq/AuNvZCv5T64G/kcXBiFGBWGZDjb/KP+DfJC9T14mpRqCsgkV5plnqhKu anya6MNGzU6ZJSIu6pAmyWKETWu61aMIlW4sC3UqJEPGhCeZdlrfX1kjjUMuuyHv8ICT vECvg7EAq22cgYaH6pCEuXpxOAzZ5sbUknAW2q6gDxFA2VC/FbL3bxVBytXf11gYU6hG b8TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F5kWLy04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a056a00088800b00681c3725a98si10473292pfj.82.2023.07.03.10.42.58; Mon, 03 Jul 2023 10:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F5kWLy04; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231135AbjGCRU7 (ORCPT + 99 others); Mon, 3 Jul 2023 13:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbjGCRU6 (ORCPT ); Mon, 3 Jul 2023 13:20:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B941A2 for ; Mon, 3 Jul 2023 10:20:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49CA660C5D for ; Mon, 3 Jul 2023 17:20:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C71A6C433C7; Mon, 3 Jul 2023 17:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688404856; bh=y9wEsiZXyMPaTL1dz0sjw4tTNmtFP1iOCMu/WZMYAGg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F5kWLy04Vh29pBF15GMTK7VVXipussQgzPetfQjHeO20xmumzR4NpUqShnMI933JV XKBQC7oZK0AqKopK6UkhPJp5hpWQMTWlAevajrAL7RkbYLfVSwTjR1i1WBgxX5r9lI ryIrrZz0TFpyN7O/tQpIFhwvZ6efHdsxaWD73fGu1Gawr2PUL/SqtuJMhoo6lKIVJG gNSh2equqVnL7yINCYDD5HdP+KQhWUXdmSJI4iyrfeHbjMkyfKNetwF+EYOn49Ivqp qprxxVTyG1inisDIKQkc/X1MTtAJctew+DyJxLcFWrIVU+DFfs364JbroMwVdfCD0q mAliLxNMjk2dg== Date: Mon, 3 Jul 2023 18:20:52 +0100 From: Conor Dooley To: Linus Torvalds Cc: Anup Patel , Palmer Dabbelt , Marc Zyngier , lkp , "Liam R. Howlett" , LKML , lkp@lists.01.org, lkp@intel.com Subject: Re: [mm] 408579cd62: WARNING:suspicious_RCU_usage Message-ID: <20230703-regalia-preachy-136bf396e320@spud> References: <20230703-dupe-frying-79ae2ccf94eb@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hjaB+7n9azmsAWzn" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hjaB+7n9azmsAWzn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 03, 2023 at 10:07:28AM -0700, Linus Torvalds wrote: > On Mon, 3 Jul 2023 at 10:00, Conor Dooley wrote: > > > > I'm not entirely sure if it is related, as stuff in the guts of mm like > > this is beyond me, but I've been seeing similar warnings on RISC-V. >=20 > No, that RISC-V warning is also about bad RCU usage, but that's a > different thing. >=20 > > RCU used illegally from offline CPU! > > rcu_scheduler_active =3D 1, debug_locks =3D 1 > > 1 lock held by swapper/1/0: > > #0: ffffffff8169ceb0 (rcu_read_lock){....}-{1:2}, at: rcu_lock= _acquire+0x0/0x32 > > > > stack backtrace: > > CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.4.0-10173-ga901a356= 8fd2 #1 > > Hardware name: riscv-virtio,qemu (DT) > > Call Trace: > > [] show_stack+0x2c/0x38 > > [] dump_stack_lvl+0x5e/0x80 > > [] dump_stack+0x14/0x1c > > [] lockdep_rcu_suspicious+0x19e/0x232 > > [] mtree_load+0x18a/0x3b6 > > [] __irq_get_desc_lock+0x2c/0x82 > > [] enable_percpu_irq+0x36/0x9e > > [] riscv_ipi_enable+0x32/0x4e > > [] smp_callin+0x24/0x66 >=20 > This is also triggering on the maple tree sanity checks, but it' sa > different maple tree, and a different code sequence. >=20 > And a different case of suspicious RCU usage - not a lack of locking, > but simply using RCU before marking the CPU online. Ah, I probably should've known from the RCU used illegally from offline CPU! that it was different. > I suspect the riscv_ipi_enable() in the RISC-V version of smp_callin() > needs to be moved down to below the >=20 > set_cpu_online(curr_cpuid, 1); >=20 > or was there some reason why it needed to be done quite _that_ early > in commit 832f15f42646 ("RISC-V: Treat IPIs as normal Linux IRQs")? >=20 > Added guilty parties to the cc. Taking the rationale & potential problems out of the equation, that code movement does suppress the complaints from rcu/maple tree, thanks. Cheers, Conor. --hjaB+7n9azmsAWzn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZKMDdAAKCRB4tDGHoIJi 0vOUAQDBe61dBL/6jJbuB/pVGpJGxz/CKpKb4hJOugvgpYOqqQD+KfqWfJ+Mmzq7 JApu5eNi1KLT0/lMstGHqiDDKL5CsQo= =eiiF -----END PGP SIGNATURE----- --hjaB+7n9azmsAWzn--