Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp406755lqb; Tue, 4 Jun 2024 15:24:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPmEPP4d2vrItyvRtrwiER66UEH7qtD1UjcLZp0xI2rmjun/mMymy/Eh+wSFqqSPs3TxYvHFVsxEzA0zzAWHv06F0L4xne02X44PH3LQ== X-Google-Smtp-Source: AGHT+IHCe4oIykR5s3UPSDqk//DHA/DEkix74G1Oivqr9ESPVhZ/xAW5A8F4rB18Oz6QUbbeNbxh X-Received: by 2002:a05:6a20:734e:b0:1b1:d31d:c0c5 with SMTP id adf61e73a8af0-1b2b70507cbmr1175631637.37.1717539864733; Tue, 04 Jun 2024 15:24:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717539864; cv=pass; d=google.com; s=arc-20160816; b=iBjp5Rly18Xe/DLOknsLXpz7qZev99iD9G1qrm1BxMLNmXcAS4NATQS4ftC4ubCAPt beEnMnj0CkYek70gbt+z0HHE2Dh5lJlj/l8gxZbh8np/FJh/ShGrtT7KSJCAz0w3OlAd mK2Jra3W+uz5qw+qh2B4q1s3COwlRyz4C7889z2dMq/IqJvtFkRm3BPvtCFvxYixZF+y y3tAWjJd04QLDhe9rJRUHglXEBwT9eUP5leLxg+yQwGFtcEhhmRKGc0ljWB0Ob+deJlP h7MqoLwPvqzQlZsKcoX3pwPrz18sulHHIQpD/awD6Z956OfpqKeck9uoqWA10/vx4y2o ycYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dGnRcIZI6WStfBbe3XnmoEIXAmcUkJrNc4VpJXteW70=; fh=5cYAh4JC8fsYjjVCWiDU7sLuhpsFyDC/zfzuztumoCk=; b=zZR5opk70Ncx48jQuk0YcTpHeU2A5D1ucANiAc2btpR1BxB1OT/KicwNap4BOFSa8V nxEjaEcz64mufE5GwAnB+ggB5VcmfYaXY45hf7UtExS3uwDtdKAvrmfh31EjtzIYOGZ3 17xSOQeECqbx/9ZqfuTp/gRmkfV/kG8nd3na8Z4vFnye98TrmKO9j+jumddkULEYKQzV q1RigQ7y/pFCelHkOVpzasJTrBivpoY/R/kqwKcSGm6vSezYcbOv8s/ZE86pdmI96h0A 8/fV21oa/OwYpHWT4TI38DppJyxsOHupZ+tU7ThdbYQd2NLeOyJMKpGCKKm9ZCEaSqAU v8wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ReR8ITPj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-702425f20edsi1939972b3a.118.2024.06.04.15.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 15:24:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ReR8ITPj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201465-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201465-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 41C67287307 for ; Tue, 4 Jun 2024 22:24:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 036CA14D2BF; Tue, 4 Jun 2024 22:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ReR8ITPj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 282E214658E; Tue, 4 Jun 2024 22:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717539837; cv=none; b=DnAaHZsEdQ+up1lmXSgnAZU8JWMwx8URYaSSiqdTS0w3H1oI4hOwvFSEgjQL6xzPMPQN/fma8eRIaaaSRTf8flCR+YeiCmWMjq03O0JLll+CnXJhWwoFmcWkX8lqowkv2gQ40tGAQnjfDKHK3DeGRdEZ7n9gzRI7vuiLCFir/po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717539837; c=relaxed/simple; bh=rhuvEgtcACTNn6ax1Ziuj5pEwRCIs7jJ27srtcjn1HU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dOc/rXC/fETodbfabDJLexBQoYpRfI8CuEPfFGpk5kDsAnPKN5BwZIrNhH09Ky5641rixmaRDSmAEWkiECFUHAwCFDbiOEGFKMQioq9nRb3mwxMIADjCMIqFsGwO/CK0uvJk6VRQUVpVSk26R9bACtQmANC8ge4ZSJhSgccSk+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ReR8ITPj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEDECC4AF0C; Tue, 4 Jun 2024 22:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717539836; bh=rhuvEgtcACTNn6ax1Ziuj5pEwRCIs7jJ27srtcjn1HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ReR8ITPjfVvne78bEQaAxExpg3RF0XUt4R8qbyytwNbtj1rg9Uu/DTwB5RDlx8eWs xcD+EGg3oETsALlRitka2BSNwJcNrf5LUdFHtxMB4dU1ecBJbQeDmTVwKqzCFudNOu jPuqz0dn2orXdacMJ/boYrrzjNPMd2wk655zYXP0PnCH+pasb/CBqS2xHdEGwUMH6L p6Lt/kjUmu3nHHcFggUbeE9Ylt2X5gYkBl3wPeVxjJYAuhJrZ4XInHuBkIL34urcJH L78EYU4svrkUP/jzbV96TMh3bv/8LzVMPFMXVE5QShtkg60QWwexbDs9Bs3SK69iVb 6aGxE1h23cmGA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 645E4CE3F2C; Tue, 4 Jun 2024 15:23:56 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Paul E. McKenney" , Dan Carpenter Subject: [PATCH rcu 5/9] srcu: Disable interrupts directly in srcu_gp_end() Date: Tue, 4 Jun 2024 15:23:51 -0700 Message-Id: <20240604222355.2370768-5-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <657595c8-e86c-4594-a5b1-3c64a8275607@paulmck-laptop> References: <657595c8-e86c-4594-a5b1-3c64a8275607@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Interrupts are enabled in srcu_gp_end(), so this commit switches from spin_lock_irqsave_rcu_node() and spin_unlock_irqrestore_rcu_node() to spin_lock_irq_rcu_node() and spin_unlock_irq_rcu_node(). Link: https://lore.kernel.org/all/febb13ab-a4bb-48b4-8e97-7e9f7749e6da@moroto.mountain/ Reported-by: Dan Carpenter Signed-off-by: Paul E. McKenney --- kernel/rcu/srcutree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index bc4b58b0204e9..d14d350f505f4 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -845,7 +845,6 @@ static void srcu_gp_end(struct srcu_struct *ssp) bool cbs; bool last_lvl; int cpu; - unsigned long flags; unsigned long gpseq; int idx; unsigned long mask; @@ -907,12 +906,12 @@ static void srcu_gp_end(struct srcu_struct *ssp) if (!(gpseq & counter_wrap_check)) for_each_possible_cpu(cpu) { sdp = per_cpu_ptr(ssp->sda, cpu); - spin_lock_irqsave_rcu_node(sdp, flags); + spin_lock_irq_rcu_node(sdp); if (ULONG_CMP_GE(gpseq, sdp->srcu_gp_seq_needed + 100)) sdp->srcu_gp_seq_needed = gpseq; if (ULONG_CMP_GE(gpseq, sdp->srcu_gp_seq_needed_exp + 100)) sdp->srcu_gp_seq_needed_exp = gpseq; - spin_unlock_irqrestore_rcu_node(sdp, flags); + spin_unlock_irq_rcu_node(sdp); } /* Callback initiation done, allow grace periods after next. */ -- 2.40.1