From patchwork Tue Feb 25 03:55:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989237 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC66B7DA7F; Tue, 25 Feb 2025 03:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455725; cv=none; b=P1nYWntOuzvxTArs4CCqnzbmHI8RzIq8j6QsuYk2TVsgeOnCTYIXJ9VJ79z2QXnTmf/aBEC2tw02vqQ8kiNtIWS3dVVab41XeuoHeomNp+s0gsZ5aU2j4Yc6NrCvD7qniK15GpxX0YblFEJLf6+Bm99tgbxSVigNKL08pI0Y81s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455725; c=relaxed/simple; bh=Zn31EETp8TJfWpBU9ejw5q50uSb1zcIQxp4Yl0+1bcU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s6469QCvjTv2NfSquaC9dhu6gqILg4AWs1Mq6WlYb8Q6sy6bVk8XKIn/3UF+FOaLtzZSfg6SVbB3AW/kR7SKrOMOtUWXTgsqkpuD6Vft/FlfUNy11QgMvobl8uD4qciH2wssqN0Bae/VSnN75eEC//QQEzGwo1fEHNxgraYjW+c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IufL76ak; arc=none smtp.client-ip=209.85.219.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IufL76ak" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6dd420f82e2so73283136d6.1; Mon, 24 Feb 2025 19:55:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455722; x=1741060522; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=WkOpGtQNsRJi/XKiVrTpjQ+EnHtEuuYo1UdNJPBjtUU=; b=IufL76akw4FYlmPOZjqQt6MA2M4NBS33hwc/sdqWNCG0Km5quk6C83FB/euKxic2At ApUAQ4yPCJUTZ4c/XwGWLtB7JvtgwC0c+c3RQ7na1neWI62DOVVWwNFDNIw2BWpBXY2J LeLsDRVCmeBevHhcQurlrR0BJ3W2MhoqOyhB3qzdTg7Zkt+MlcIq1Sxlk9nfzyIftSMz tGIZuauaggscn2essZ6qTyEWHz9W+h1UJwZx6DQHlzIGagoAFRHXLbXLXmEatgJ5BZmH bFc7PW0ZB6YlbcL9TUEDR2TwmGWKRlAWzAfVtahlNOrQ471xkbkI04bAtZay5CnY48T3 s2WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455722; x=1741060522; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WkOpGtQNsRJi/XKiVrTpjQ+EnHtEuuYo1UdNJPBjtUU=; b=FL9B5207ATgujrlYUs9AYA7nKjdRhSKqhIeMNnIo+hELx6sXocxkr7RKyWoSdGMSM7 XdGqZ4QZgFAc9HB0/BjE4/Lfs6TTSpkhXv0PDLaZSPHAxL+JfIpWiyyV90NSjA6eRtZs 7RvyZCGInY3wn+nV7jviR1RvAEdXN3SCHwMepXnCWHBw0BRItOvA31SCzscDiDn7e46+ iIxnub4zfdYBn1ZpwGnhuK/pW0mHFtitgioD19mcotOmnHAVocL5G4PeroQk+qYcHCW3 hRTpv5X2s1ZHRmHpdLRqN898oGdsiWAH1kGg0xYnu+PFBCWQ/dvIzPlHP9xvws0KpaBW RqyQ== X-Forwarded-Encrypted: i=1; AJvYcCUq3k9Cw6/yTrEVCZknoAx7MCu5mgl9dj2QQQqMvFrEUb3QL2q58RzxkV1qqrh0mm2fJnbUVFoqqXTS9Et67ENGUb94@vger.kernel.org, AJvYcCW8RyX8hafE83WjcvpXwLt0a/Pt72KkFL1Whp22Exfyc6d9ZrANQiEYMLW0TRQvBsGj19EZy4357WSjmq19J32n@vger.kernel.org, AJvYcCWR4ZyCMVlsJTAYL/CCokU/w1sbfYj93G20inopohHCyxfrejyE8n5jbPseELApG6UWl5Hle/OstYN9I4A=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8bQTMzKrTlhiF0oAuMI57csDJMehw799SMyGXTZGUxBC0AbVR BhKbFrikf3WvExaEhXkFF1KEBTI5tFxRlpTq5+GgrLdTyAllwBqQBKzs7Q== X-Gm-Gg: ASbGncv9XhTI8Inx7l6zB/YMvmOzhREZX5mPbRjIP2qBFgccCV6TxfJW/mzNzWAosHe IGePtOSJYbkDTydtKjurW3dx8ltdewoKZNhoPh+6NU8hZ4ir4qMLrhA+iczCUDhl4yHhxDEhn9P LZu5kF4XJchtZeulnW+ojqF3W37fxtyEfR0UCftDeHhvgU+Bray2A+CldDF4R2mZ+0eQU2TX+pQ gtqjYqL5+j4UQZ6Hzl1FzQjbVcnwdm8CvF0Y0R2BCbtZsNcZv9zZPW3CitgJnZC6eJ9McktGbgr qvCv5Colj1+N9JvJBAqTkSb4v5AfKPh9iXXP8GZDA9Vf+zvbQULrs0DWeFb/ZWUWquYHQJMOEXp M57LS3zjyTKvkaZMb X-Google-Smtp-Source: AGHT+IHFM7nCfANUJnQWs5ua173vFVnzmAQXQGQ66e13i/keK033791LhwthqRphswwZvNeSbnygmg== X-Received: by 2002:a05:6214:f03:b0:6d8:9be9:7d57 with SMTP id 6a1803df08f44-6e87abbab41mr27890766d6.37.1740455722610; Mon, 24 Feb 2025 19:55:22 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c23c29930asm61016285a.2.2025.02.24.19.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:22 -0800 (PST) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 6EAA91200066; Mon, 24 Feb 2025 22:55:21 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 24 Feb 2025 22:55:21 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:20 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 01/11] rcu: fix header guard for rcu_all_qs() Date: Mon, 24 Feb 2025 19:55:06 -0800 Message-Id: <20250225035516.26443-2-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration is conditioned on CONFIG_PREEMPTION. With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply CONFIG_PREEMPT_RCU=y. Decouple the two. Cc: Paul E. McKenney Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- include/linux/rcutree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 27d86d912781..aad586f15ed0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h @@ -103,7 +103,7 @@ extern int rcu_scheduler_active; void rcu_end_inkernel_boot(void); bool rcu_inkernel_boot_has_ended(void); bool rcu_is_watching(void); -#ifndef CONFIG_PREEMPTION +#ifndef CONFIG_PREEMPT_RCU void rcu_all_qs(void); #endif From patchwork Tue Feb 25 03:55:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989238 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EE9719F495; Tue, 25 Feb 2025 03:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455727; cv=none; b=dhy2T3BSS415G0Pb2tA5I9BvAA/AgHScV/gR2ZDWDY83n+p30b6+0HAbRSWSUpc4zkOlx+KaT6Lz3lMZ/BXLwyhlZnQp9LPsfkt+mjnL4b4Vzf8iP315RtUvxOOeZmJdS/KTS6rdVVtP+Nz6wD2oVW+03HZYba1CdbzL5S4yyQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455727; c=relaxed/simple; bh=A/VpehmTL1Oxz9vYinGJ1z/0Up0xgizTMk9jwY4/OxE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B4IoJEMTFHV6WVkbcm46GoH7w+QSczWGG5wtwnG1ryCHjG9gypbs7txyyntdeOuFdStH4ZWcRgSbWEIeaCMYGfgLh03M9nmzuZkdq+o2ZVyc8M1M3THHnDbac92YXUf6oVInOecu1waOt/t/OVdhLxW/YdlGKAH7/db2rIF/YiM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wxf//KbF; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wxf//KbF" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7c095b5365eso335000785a.1; Mon, 24 Feb 2025 19:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455724; x=1741060524; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=UAMp8hSyK7XsiD25GD9QUAAoq1cOP4T1EfIXDur7CUY=; b=Wxf//KbFqbzMXLob9PDEH29DZ/thSd+BuYJAV2kdKucs5vw4883/AAGehbatkuuiL5 GYgHAhO59Cgyvil+CHcxrIWBkIBK4Atqirpl7qrVhcg/bSZZPeCbFivMYWWkh93WkEMi YnWuwBUVLd1mcZwqgsR9CcRAdMHqkjNLFzvWH8vIvrplXzk82KKhIzC2DArY5CmqRpSf 1dCjYRJejSf1jFN2YwJYuDjfcgbnpsKH00+nKw7eM+Z4oE26IZZ3eBqdDA9K8ji1oGx1 2mPIORXx53fZEwA1vPNj9pUj0WWpZ73ghU9I7nUhgM85NrfESuTycWWi8lH6XTMwgk92 hNLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455724; x=1741060524; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UAMp8hSyK7XsiD25GD9QUAAoq1cOP4T1EfIXDur7CUY=; b=UbKQ8jB4U8RlWrl814RuAv/FnK+q4xT1MIP0W5+V/EMQOTs9OZKSK67th6yGEuq9to dMT+rd0k/LeVSDWaUHRearYGojPwofEH7pDFgXN2ke5MhHcj1VJ5sn662NDwZHr26ouH n0SgRhNli4Y9creJsga2AlZR9GLzYgsAfC014gvIVKSvxRmPVzy6NQE6JGSaMg5amuA3 A/qWX/7CXmatKEBPL2aLn9vBKoJKPoGStJyt5fPKSMbqpyrIu+LG8wdgyiSOnAGOgyFL l22L3ph3MPNS8mFAVh/lh9ziuUWBBxkSuyUEt7Os+apaLYT9CE7IrmKOT97cJQvqDFtb wCVQ== X-Forwarded-Encrypted: i=1; AJvYcCVa5kcyfAH/cZcsMI9Alm/jkuopDSIsAy5DVemYWMDLw3TT7+EKDoM02MRKrLdulQ4v3aSFfOw0pd1RmU0N9sm8yLs3@vger.kernel.org, AJvYcCX6CEsrKhAlz11qLUuGdNWrwBZ3yCwhiRXfwm6KZ8v4s6L5FiadCeuKCEOiwv2WgrkA0QT5Nv8Fmsb9gfm6SDRx@vger.kernel.org, AJvYcCXhytiY95d174IkiUm9hXkYvGycdLZVrQqZ61OeHS37XaQQsdWjCqutPWbyoh+Y08HRlYWBZVG4KoeOBmA=@vger.kernel.org X-Gm-Message-State: AOJu0YwMw0H8eir4F/omEOnM0Qf8MGP4r+RE9WF5PM80ABfyBH8h2uEM DdzGOp35sonntZVajR8OltGa6VZysxnS5at5ZeGxbjYR99nkPnnY X-Gm-Gg: ASbGncu5s1eEaHc1ZLAXSUe+fK6UYtjn2GB9z1jI/s88QmK7ks5UMxgiP7+G3+L0RoM FEXYD5LzHrbZNAJmlR/Jph48lBoFlyRIxF1rkYMduWrVYc3IA1jr1Gnfd8nb5U0iGre99BrldhG xH6uMoO9AmVaQRvngCAXajd6crl1yZcCD68Y7J9nGsL6AQ2/aKWkh5pXaoK2L4CCvaH7TV5kTIl UAWlz8fNB6jzHwmaitS8iVxp7E7apLHS4fEfdvqlYTaxglZmYv/lmK+sMY9f6mvLsc/yZgp5dNk udaIv7nMMjzSc8GHrPFJEaSAbgiic8/cdHSfB3DjOJR3uL+f2Xo0Jlg9fJd8Rpiyv3v6rpU08sT ZhUqZPccyVbDzXiE9 X-Google-Smtp-Source: AGHT+IGCSWdxbzgQ8ZHPgeeMU41gQqhAFunf7D6fAu+8M1wWlojOk7D1fxQNY2FAngPgnrW6omeP0A== X-Received: by 2002:a05:620a:29c2:b0:7c0:ae97:7fab with SMTP id af79cd13be357-7c0cef538c3mr1983966285a.39.1740455724319; Mon, 24 Feb 2025 19:55:24 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e87b09e51dsm5087626d6.66.2025.02.24.19.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:23 -0800 (PST) Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfauth.phl.internal (Postfix) with ESMTP id 159B51200043; Mon, 24 Feb 2025 22:55:23 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 24 Feb 2025 22:55:23 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:22 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 02/11] rcu: rename PREEMPT_AUTO to PREEMPT_LAZY Date: Mon, 24 Feb 2025 19:55:07 -0800 Message-Id: <20250225035516.26443-3-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora Replace mentions of PREEMPT_AUTO with PREEMPT_LAZY. Also, since PREMPT_LAZY implies PREEMPTION, we can reduce the TASKS_RCU selection criteria from this: NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) to this: NEED_TASKS_RCU && PREEMPTION CC: Paul E. McKenney Reviewed-by: Frederic Weisbecker Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- include/linux/srcutiny.h | 2 +- kernel/rcu/Kconfig | 2 +- kernel/rcu/srcutiny.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/srcutiny.h b/include/linux/srcutiny.h index 1321da803274..31b59b4be2a7 100644 --- a/include/linux/srcutiny.h +++ b/include/linux/srcutiny.h @@ -64,7 +64,7 @@ static inline int __srcu_read_lock(struct srcu_struct *ssp) { int idx; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY idx = ((READ_ONCE(ssp->srcu_idx) + 1) & 0x2) >> 1; WRITE_ONCE(ssp->srcu_lock_nesting[idx], READ_ONCE(ssp->srcu_lock_nesting[idx]) + 1); preempt_enable(); diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index b9b6bc55185d..e2206f3a070c 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -91,7 +91,7 @@ config NEED_TASKS_RCU config TASKS_RCU bool - default NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO) + default NEED_TASKS_RCU && PREEMPTION select IRQ_WORK config FORCE_TASKS_RUDE_RCU diff --git a/kernel/rcu/srcutiny.c b/kernel/rcu/srcutiny.c index 4dcbf8aa80ff..f688bdad293e 100644 --- a/kernel/rcu/srcutiny.c +++ b/kernel/rcu/srcutiny.c @@ -98,7 +98,7 @@ void __srcu_read_unlock(struct srcu_struct *ssp, int idx) { int newval; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY newval = READ_ONCE(ssp->srcu_lock_nesting[idx]) - 1; WRITE_ONCE(ssp->srcu_lock_nesting[idx], newval); preempt_enable(); @@ -120,7 +120,7 @@ void srcu_drive_gp(struct work_struct *wp) struct srcu_struct *ssp; ssp = container_of(wp, struct srcu_struct, srcu_work); - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY if (ssp->srcu_gp_running || ULONG_CMP_GE(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max))) { preempt_enable(); return; /* Already running or nothing to do. */ @@ -138,7 +138,7 @@ void srcu_drive_gp(struct work_struct *wp) WRITE_ONCE(ssp->srcu_gp_waiting, true); /* srcu_read_unlock() wakes! */ preempt_enable(); swait_event_exclusive(ssp->srcu_wq, !READ_ONCE(ssp->srcu_lock_nesting[idx])); - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY WRITE_ONCE(ssp->srcu_gp_waiting, false); /* srcu_read_unlock() cheap. */ WRITE_ONCE(ssp->srcu_idx, ssp->srcu_idx + 1); preempt_enable(); @@ -159,7 +159,7 @@ void srcu_drive_gp(struct work_struct *wp) * at interrupt level, but the ->srcu_gp_running checks will * straighten that out. */ - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY WRITE_ONCE(ssp->srcu_gp_running, false); idx = ULONG_CMP_LT(ssp->srcu_idx, READ_ONCE(ssp->srcu_idx_max)); preempt_enable(); @@ -172,7 +172,7 @@ static void srcu_gp_start_if_needed(struct srcu_struct *ssp) { unsigned long cookie; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY cookie = get_state_synchronize_srcu(ssp); if (ULONG_CMP_GE(READ_ONCE(ssp->srcu_idx_max), cookie)) { preempt_enable(); @@ -199,7 +199,7 @@ void call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp, rhp->func = func; rhp->next = NULL; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY local_irq_save(flags); *ssp->srcu_cb_tail = rhp; ssp->srcu_cb_tail = &rhp->next; @@ -261,7 +261,7 @@ unsigned long start_poll_synchronize_srcu(struct srcu_struct *ssp) { unsigned long ret; - preempt_disable(); // Needed for PREEMPT_AUTO + preempt_disable(); // Needed for PREEMPT_LAZY ret = get_state_synchronize_srcu(ssp); srcu_gp_start_if_needed(ssp); preempt_enable(); From patchwork Tue Feb 25 03:55:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989239 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D80161FAC52; Tue, 25 Feb 2025 03:55:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455728; cv=none; b=R8PagrY8lAvP+wzUmO6v79tjQsqZo+3smZNBhovxrNIJTI1ozxvdB+aSUloAxRrdHRvk6i1cBcEBGWoAp3sW3He2Pvfh7jmmFH2FzWCHkhG9UtpDzd8cW167hSJ35ydovYcXzpnoYSMcedpYy6KA+jRlap+If4xI1KOB9DRTu9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455728; c=relaxed/simple; bh=ESQAHp4TWxX9hz7AnJ1W2Ktm+D0hgjSpWAQVAhkjhxc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LK+yn60+xoqSni58fizn/zI6WSqaSlwC5Z3vby9TyGXmnMUTd/fnauKQleRNHSOoXdHwQNcdeWDttFHtvvP7h9KgKIuXx5a5fsVZe3wGJ4UonqXtGnpz0sAijEb42Ht/1LaQAHZCVSC49UsGijEdlhqCUr4Htsw+7+TxRoAX3Hw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SoTurwJf; arc=none smtp.client-ip=209.85.219.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SoTurwJf" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6e67fad4671so44877396d6.1; Mon, 24 Feb 2025 19:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455726; x=1741060526; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=XsyEkD9rvPtl257B6PtlDCoSMiAXhw0HwIEgtCwXoUs=; b=SoTurwJfzHeYMFMqRTiR9IP4uVcRlOraPHyqBlNMFGNYwTZDadhzIa1UkiMtOTNZxV s/++qXvKFXB0CYFS8/zsJdXHjq8vJG64WFmSThYLvINkfPLqnBbNNwjSYFZRN9J3TfNN +EUpVHlzeihVobbsMoF/j55K1BvwOcGghPlHNng91x7OB/IkbUkvcbfadXb8ypEjTa7x BglGpt9MDVEESlA2Y5iI5uNgYZGPvCRO2ZT9s/1THZFVg/qaXhOxjzWqih58p+fXvdAA iwt0jHr1YcxhYLuCUNW2k7d91cbfbSdSURGXXiLCX+uPXP4rXLb1JKRK5wTWbHWZWVHo 8UXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455726; x=1741060526; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XsyEkD9rvPtl257B6PtlDCoSMiAXhw0HwIEgtCwXoUs=; b=QpkJO825WQKcofWpivbAVedAZSCadr7Tg0bxZ9s73TbNnPC34ayCFKZEopwRJ4UeqJ JaeiG3X19FyFeE7gTMX3tKHv8Dd5rWhl8+nyBvwSkoMJLSDtGcI61j3e4mg1fZimiw2t 0bRTcy9KtwSsiEXIFpHRUupIsgRMRHhWgpIYQlfcyi+MRJuw3tV/HQGWNKIXK0eHAAHQ k/Et6QwpVldgHkr7fesdsdkLMQ/6H6MAHph9ecLwHzXDQ46JwW30JCfz9sIudQx/reyx 4bLfd074T2jfN12z9vj3vbW+CIZVKMxWXIwaLPjATlBrObUOnthTCv5GUeT0wMgR1d7u 1LYQ== X-Forwarded-Encrypted: i=1; AJvYcCV82HXkPY+vKhiBAsbj4n6+7JZwtOo01obpvXdmEJecnd2+xkmFFgWYfpUaxTayFYPB86tAjANUt0VGtOA6HZSD@vger.kernel.org, AJvYcCWxLQ/pohsHGu480R5B85PVXVJs2+cHtfF8OL8gzd384mfdd8rx7oxxseFG4PDJvF8bDeOGOHWlPYfB1dK94+oWlw/n@vger.kernel.org, AJvYcCXqBc3fKBMwD/vVwur2g64HFaqUnUIendgEBOJUaUgm1UkXc8KYQGhuFBrS+LKacOP4f8OZSPgXUtihssM=@vger.kernel.org X-Gm-Message-State: AOJu0YwlIQxw3YIOuTtgpAxWin8+KMRGCnp0mlGpB9IbJl8fy4chrEiv 3IDd5S92iO/9khTcRgOA/X4H9YBczXiJvkj5gBbI4y8JIPEkUjJe X-Gm-Gg: ASbGncvZiRhXEzxKtytD2LDFPjCBvmCQ62tfteQVt1CHMOnr3b2/EfPOFArY1Ffevm+ aV5df/WIAyIS5RrmHyi/n7RaAzIc9bGNrSJ+B3HiqWb7HF2zH4e19UMPt/LBVufI5lmnrYNBW2O h7ICcN5GBjTyLA8PPvf5ZGZ8OnLxKHRlp0Ni+VJmCZyOnYRxsaVju9W+uyDcOrIO/k3O8PX4V6M zineOT2AK+A23zVicyiO6UYXK69mH0DdZvOMXjpY0bEBi3MF4Vtz2zny6YcsF2HuukhKUwusOkH 6J4i0fInD+TtDHY1xjLWxmJxkGIvgA+aP0jvf6PwjkCujd5meAoUoMvzO45aQlrNW/5WzNAKBQi a5h0h99pPT6jdVZM4 X-Google-Smtp-Source: AGHT+IEBeyRItTwAFtwXFvI+3fMU/jftvMugN1ITAqxt40ZuJAixUMZ90OXiQu7DyBZhCeUtaj/dew== X-Received: by 2002:a05:6214:4009:b0:6d4:1bad:740c with SMTP id 6a1803df08f44-6e6ae7d0bdemr193820706d6.4.1740455725715; Mon, 24 Feb 2025 19:55:25 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e87b156266sm4971406d6.85.2025.02.24.19.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:25 -0800 (PST) Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfauth.phl.internal (Postfix) with ESMTP id 832BF1200043; Mon, 24 Feb 2025 22:55:24 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 24 Feb 2025 22:55:24 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:23 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 03/11] sched: update __cond_resched comment about RCU quiescent states Date: Mon, 24 Feb 2025 19:55:08 -0800 Message-Id: <20250225035516.26443-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora Update comment in __cond_resched() clarifying how urgently needed quiescent state are provided. Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 165c90ba64ea..d328707626e3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7289,7 +7289,7 @@ int __sched __cond_resched(void) return 1; } /* - * In preemptible kernels, ->rcu_read_lock_nesting tells the tick + * In PREEMPT_RCU kernels, ->rcu_read_lock_nesting tells the tick * whether the current CPU is in an RCU read-side critical section, * so the tick can report quiescent states even for CPUs looping * in kernel context. In contrast, in non-preemptible kernels, @@ -7298,6 +7298,8 @@ int __sched __cond_resched(void) * RCU quiescent state. Therefore, the following code causes * cond_resched() to report a quiescent state, but only when RCU * is in urgent need of one. + * A third case, preemptible, but non-PREEMPT_RCU provides for + * urgently needed quiescent states via rcu_flavor_sched_clock_irq(). */ #ifndef CONFIG_PREEMPT_RCU rcu_all_qs(); From patchwork Tue Feb 25 03:55:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989240 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AA1D1F5EA; Tue, 25 Feb 2025 03:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455729; cv=none; b=AQ4wahre8KU154QyS1PxEUxRGQA1o2QaMqFmxfLYfyUW9EstvFCTncCb5+D35h0WNB0g7k7i+dejodIY0ULriCRp8Bp2d1Ja6Qp3cjbk3egBMMS/JlAw2v0wgZmKt/9acF1aQyYds+ilOZUVPRsGzQIFU+jf/0lKRRbxWtawfUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455729; c=relaxed/simple; bh=N77KqbFVCj3RUrUBBHfg6qA4TgoamCkJ9sF4ME/N0iw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uRZ8yES9/04CGU6x5WgNfBRvDNXEeLgnPSPUIUJ23b1qyxE1f1SUzXiJmuV3XMnFZqV458RUwGKdh4GT1LVD4L3Yo/dcA4cQLLo+Yld8yojv+4kyjlo205EBmkxKKNbF1RB8KWs1rPXbmGTVx7Iued9fXTTTaYgDyqx09r9k6OA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i6TgZHoQ; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i6TgZHoQ" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7c0848d475cso733078185a.2; Mon, 24 Feb 2025 19:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455727; x=1741060527; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=6bZjSIhc7HiilOm6x/1wfoYX7rNiE79eoPzAm1Y0WKw=; b=i6TgZHoQ/RMyvw98bRrOwmlHNpPi0IDP+aTHHsjQ5QuR3CzktNAQRR3UNypekzwTKP YPo/5d1PJlh6xAuu2jnWgMSYhrCTDjpX+23ZL8XinXHSiKimS6ESyBMhtXM9dmadmgXX Fyehhg+yEDtnyNdmBIMJBCnn7VEQLkOqhcm9bn+dTtplZgW0N2D2MvksQqJphb0WjX/j YYjdu5vKx/Tx8zoQko8klrM1iKx+nDz2VbgKU/uLwl0npU8S3o75KkuTwbD6Nn9vtoRK qJmma7qZ+tM84vlxj/2KaQXoXUVw8mvIYd7UUGuY9GxSoqibJUzM8lM+D79tuI9leF0f HDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455727; x=1741060527; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6bZjSIhc7HiilOm6x/1wfoYX7rNiE79eoPzAm1Y0WKw=; b=n6ahyp8YuFUWX+yZXvYLvGOpsB8TfldbMa+CRVgCySfZ/7p67wxYhECdVbP7nLaDfS zHeQs7Damug36D9FBh+lu3ehCyKYbBhWdAbqUFFYeA14lb7ncjRx9F7IyNQWueymxRuc o81N4FlCuDkmPEfZRZbch3Yidw+xu7QnFC5z/1I92KIW/67vuq6BM7dtnarYCaFrJdMt 2oO08wOyzPRRbP89IpguvP382/QdN5XVYfzU7NzRUPsDOxvpcpqnr+QHh6vQQRoTLdkW 7dFooUJqf6i3tHw44nRTDjSINoWIfPUKM7w69EtmjSHDvSXFxesMSr3xnFiuVHIeWFFO ZzNg== X-Forwarded-Encrypted: i=1; AJvYcCWbqXTDrD24Ze69B6TR4nuDt/H2d0GYMkU/m/ubEX9ifRp2lhDfAZofgZJJDuZM2AFgu85chW5ZmCyOIllMvfHL@vger.kernel.org, AJvYcCX8KaJXuxPgB2OO90UCXd9Y8tme/jZa3YSWxRUMe8hlb1/y7va+Au7jK3H/ZBdT+RFcprmjWszh6Czx1tGT7t45rK3H@vger.kernel.org, AJvYcCXtoaya/sGccy5hpMLwSW5Cm5v6uew6kux+2qtJ451Fet7BMhZiLQ2Hx5bUdOPDoPJDABLYbVztOAIaXfI=@vger.kernel.org X-Gm-Message-State: AOJu0YwG0aZ9cRrXGgenEI63wi8c0AgoyG6s/eokKIjv6OzIWB31NaA7 BYbZbeOkdo0AUNX+yM2YGCAP9EmcIgtRTK3ba/3aq2rcri67F68V X-Gm-Gg: ASbGncvPxHV6pRw56pviRKT2CMsfsHisS3lGLCELjcB6//j7sFZqcjDLefU8M5A+irn Ii6syTk0Mfs+DPDar614I/SUyRNYUPzjbrngRLa2susROCCVEGvraEbtWAfsevizY6jYPwfBsf1 8Kf5JUkjvGzRihYTdC8cZ0A8kqN674SLYkn+49sqfO5kO0clVj4WAZxB7hw1gFzhHqwBMgZ9Fa4 hpxZcXHdcvuArcGUYfaNcVvHk5i99F4cUmZDHALDQznTtpkFDYT9UI4UFOE3E8AJYRMVHe0UR6k 9TaG0d3p00MAER0RVkNiN6IxGEJP52VPraHml2KqbO6bYzpa7y+D+SqidXzZ//UBLkwkU6JcxO2 wDnVmTEUvx6QUHS4X X-Google-Smtp-Source: AGHT+IEC0C0d+DYM8KdIaUvUgJgks+JgO4LiPSAwNKNuUQIS0gx2Q8fQIw/0qV9UDTxtFURTT38lEg== X-Received: by 2002:a05:620a:f02:b0:7c0:a389:f26f with SMTP id af79cd13be357-7c23c047145mr175846085a.56.1740455727170; Mon, 24 Feb 2025 19:55:27 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c23c2992ffsm60738785a.7.2025.02.24.19.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:26 -0800 (PST) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id F0B7B1200043; Mon, 24 Feb 2025 22:55:25 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 24 Feb 2025 22:55:25 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:25 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 04/11] rcu: handle unstable rdp in rcu_read_unlock_strict() Date: Mon, 24 Feb 2025 19:55:09 -0800 Message-Id: <20250225035516.26443-5-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora rcu_read_unlock_strict() can be called with preemption enabled which can make for an unstable rdp and a racy norm value. Fix this by dropping the preempt-count in __rcu_read_unlock() after the call to rcu_read_unlock_strict(), adjusting the preempt-count check appropriately. Suggested-by: Frederic Weisbecker Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- include/linux/rcupdate.h | 2 +- kernel/rcu/tree_plugin.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 48e5c03df1dd..257e9ae34414 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -95,9 +95,9 @@ static inline void __rcu_read_lock(void) static inline void __rcu_read_unlock(void) { - preempt_enable(); if (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD)) rcu_read_unlock_strict(); + preempt_enable(); } static inline int rcu_preempt_depth(void) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 3600152b858e..9573408a9800 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -833,8 +833,17 @@ void rcu_read_unlock_strict(void) { struct rcu_data *rdp; - if (irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) + if (irqs_disabled() || in_atomic_preempt_off() || !rcu_state.gp_kthread) return; + + /* + * rcu_report_qs_rdp() can only be invoked with a stable rdp and + * from the local CPU. + * + * The in_atomic_preempt_off() check ensures that we come here holding + * the last preempt_count (which will get dropped once we return to + * __rcu_read_unlock(). + */ rdp = this_cpu_ptr(&rcu_data); rdp->cpu_no_qs.b.norm = false; rcu_report_qs_rdp(rdp); From patchwork Tue Feb 25 03:55:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989241 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A5EA1624F8; Tue, 25 Feb 2025 03:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455731; cv=none; b=LlxtvM6UtpT/6gRryuLntVI7VUQv/qOZrCKseffegHvMQeJaMAuam2KxOHCdclwKIGiSj4v1y/6h4u9Adwn7aN7VKqZ4Ss7u2vHdk18uMMZ1N5ZPLToXSDBWW7W+s1X+GOIwdAh4/BycJrF6OtOETX3/rbbPMIuEAplZefNZuPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455731; c=relaxed/simple; bh=+xWSr+nkJ64yuyk2bAtOMGffsUZkkwlgArf+svUx41k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y27l1Ff6E9de04PTY2UmpUV8TerX6voY5cuQrRO9yFYApWkWAAtVz98ssk2c0I/Xhvw9iQWEj9meHN16bA4EP7OAp2IyxLdAzMVrGws28lo7fbmBIHRvttq/9nhBaZres41Z0iA6Yo2G3J17QqJqRPdiKEY5FVAmNGAUtlKmKKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q92DnqcU; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q92DnqcU" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7c0892e4b19so618526585a.3; Mon, 24 Feb 2025 19:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455728; x=1741060528; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=jdozoCwQSzFwrrBbMNFpZ8ApNw9FrREQJIW7RONrtaw=; b=Q92DnqcUNMhWvJPA8wEbk6/EfjU29KXL8I0QfW5t/DtmCYvqghfIQoEER2OzElAbw0 VXEymbwS9VcVkHkK7U0tiuvrcf5453N4bG4HXvHgMuwkWwLUtWySRTwxsGGj9Ut4ODKJ NKOY4rufoKRejCYqKpz0NN17KXwg8eyGnqGKih1SfLz8/gzQ/BULue9aFvGZdzfImFFp Nce4KABWQOMZpkVXJy38VPnvF/rFyD1f0NMTxanZKa6Xn1iePwRKCVc0scVKw5b5xv5Q 1FSq2zFlcPnFu/ncRIh8ESPirHv0NNZx21PAqN7NJMy5l12R1+DcPc8duAyUq8NtE3u0 Z7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455728; x=1741060528; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jdozoCwQSzFwrrBbMNFpZ8ApNw9FrREQJIW7RONrtaw=; b=GbkCuMk1oWQX0h0GbNROoa2QfXPW/aKKYVwy754o/a9RT1uPPOiiPHbWe0CnKZkXmQ ve8i36X+p6u4skyoEPdNYZ9Jm0gsbZkrurC7HbjaS9ZwqIXkr1QgNdNPk01PX4mnWzgT rPH2ADeiSOI/yRlBjvoM5Uwon9qjTRNmMfd5xy8g9rt2vx1+N5WNvW5e/SLTZNc0rHDw JUB2HHlR/4iFeR98o5UvC9hqgCU9FaLmJJnz0oU1cF3DWQws7MSmKbHZBG/8T9nt0nZG Mim4C1EnyVkILqubGYq3Ip4wpxeTdxyuJ11DOyzByrL290h0y1mfNYiCaA7UPIsYiefM OJhg== X-Forwarded-Encrypted: i=1; AJvYcCV9eXusX3xL7t9mK4FEFq/admPDLGxvM4qQyfPDr/1qY4qgTZ7Q2sYycuYOsMMWVqU35Q9bcPLb8wDQsmf2eTN6xkyy@vger.kernel.org, AJvYcCVBKgcVCk0QqePrkLmK6nA7QFvwypRofOHxSDd2s3UpaLfmy7IiXDgjIlWox25Y0vJxNx18F9wxdYFb9N25e7FW@vger.kernel.org, AJvYcCX6j1C4UkCougBuYMQDcyEl7sx7YfgSTlpYPUX3WW50VrqETzZ7y22XrCPI4WLjeluFpizbKGGtuGmG55A=@vger.kernel.org X-Gm-Message-State: AOJu0YwCiDoMJudwbYnRtEFwpPn70YjwmmoOXplAb/lf5UHah2nmM+cQ D78BcHiFU4hp3bemvmLdO3IjJ4oxVgYDAygVAP8VBA4k070mJDCE X-Gm-Gg: ASbGncsZwuqZNs1LJN1dZDt5155vg6CyWBdNQft5xELC5MZUYLMZo2OrOwYpFFBF/Sr WSSMTDX2v3IA/ZDSHffqB0mSlyWQkZkaZaKi7TeLy/FtjqDiUPSdGxkjTtXcN8A2GmAog5eCE9l ff+AuEsiK8F7CkNwLUmVQYllWSt54+YEZxltY6vOn3C92cENVB4YNNLLt7locHLAfSlK5rHUELV Jbja+gfN0hGxECEsZQnce6EHfDsusCFOQtg1jB/Ayzbujwhw+KFLdScFRUkL+6zdm/n3cRLPRvs KCEfObi/gCb7YkuX0BoaXNboX2pi1CO5QdKMLEApkR7tXkOlQpVBrm3UiK7/m96Xmgz1vBgndO7 Ds5n8ZvROF2h0z16o X-Google-Smtp-Source: AGHT+IFTwNMKfPJKSVdkAd2wzvyYLeX43jvuaeqy4yYDCxwRmbSxY2gEiMA5fWXJHX7/6sVrC3Ghhw== X-Received: by 2002:a05:620a:4606:b0:7c0:7d34:6a7b with SMTP id af79cd13be357-7c0ceefe59cmr2223508885a.19.1740455728549; Mon, 24 Feb 2025 19:55:28 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c23c2c241dsm60007785a.58.2025.02.24.19.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:28 -0800 (PST) Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfauth.phl.internal (Postfix) with ESMTP id 6B68B1200043; Mon, 24 Feb 2025 22:55:27 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 24 Feb 2025 22:55:27 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:26 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 05/11] rcu: handle quiescent states for PREEMPT_RCU=n, PREEMPT_COUNT=y Date: Mon, 24 Feb 2025 19:55:10 -0800 Message-Id: <20250225035516.26443-6-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora With PREEMPT_RCU=n, cond_resched() provides urgently needed quiescent states for read-side critical sections via rcu_all_qs(). One reason why this was needed: lacking preempt-count, the tick handler has no way of knowing whether it is executing in a read-side critical section or not. With (PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n), we get (PREEMPT_COUNT=y, PREEMPT_RCU=n). In this configuration cond_resched() is a stub and does not provide quiescent states via rcu_all_qs(). (PREEMPT_RCU=y provides this information via rcu_read_unlock() and its nesting counter.) So, use the availability of preempt_count() to report quiescent states in rcu_flavor_sched_clock_irq(). Suggested-by: Paul E. McKenney Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/tree_plugin.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 9573408a9800..3c0bbbbb686f 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -984,13 +984,16 @@ static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp) */ static void rcu_flavor_sched_clock_irq(int user) { - if (user || rcu_is_cpu_rrupt_from_idle()) { + if (user || rcu_is_cpu_rrupt_from_idle() || + (IS_ENABLED(CONFIG_PREEMPT_COUNT) && + (preempt_count() == HARDIRQ_OFFSET))) { /* * Get here if this CPU took its interrupt from user - * mode or from the idle loop, and if this is not a - * nested interrupt. In this case, the CPU is in - * a quiescent state, so note it. + * mode, from the idle loop without this being a nested + * interrupt, or while not holding the task preempt count + * (with PREEMPT_COUNT=y). In this case, the CPU is in a + * quiescent state, so note it. * * No memory barrier is required here because rcu_qs() * references only CPU-local variables that other CPUs From patchwork Tue Feb 25 03:55:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989242 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FD0F2512DA; Tue, 25 Feb 2025 03:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455732; cv=none; b=CEQ29hTHZ91zYVeywUy2mIdNxXG1nwVfsSm6RAXiamXdzCAFwo63o7mJtjjSDdDBRxhGax8d2qv0BmpeQ3cqFXDA3Odw4Fj7Tz/p5mSPAwDilaY397WntV/ly9wlOJn/IQpn21XQxqnnUln6Ad+rJ93lW1/DdT/ecAAQ1F+nCac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455732; c=relaxed/simple; bh=vAoTryD7Ubn6jeOom5AqCgaUTXh/NIMl45CYHdmRAEw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hvlJ47p1IS0KWzd+Nb/ot+mhrEthz8qYmMFM11tCVzyxHu7UqNNhxZDMMsp9yJfPLowOGlkwDGJlspC8BV82Irue77/GhFl6mRSGYhdjrBcfxcWboIxkj83CbAvA5nXdzsopfIuAl79zaN6aynjfdFnIGHHY6m9yblpLoCdDByM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B1wSVsYR; arc=none smtp.client-ip=209.85.222.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B1wSVsYR" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-7c0155af484so761459285a.0; Mon, 24 Feb 2025 19:55:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455730; x=1741060530; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=HQARWggofyARbzO1v8dhj3CLs+WsMSpSVZ/wO7/jEqQ=; b=B1wSVsYRL6U+gSCg+MLCkmM88uDandHBOwnJy4f3S/2zLFnN6CWEfsZxhYSPUtbtrT wh246dtk+kdhIj7+xST8DoorB1LL8gzxZa7Dzg/HbZFDRLRBu9JXuKPzD3oPFxvq7IP+ nQqbapBJZS2HXsYk6Os3HaovEch8GNb/thMigEGvIC6G9OX0SYCzeIBnIP++CJAbjFGN W0yTBWDfBZN1YJBuckcwv9lr9jJpi/e1v0PMa4oWw5lqwVHZI1W7X4tkkeV3cb9uDcW4 xNcSunt/hdmHrcR3K55wkGiLliMm4cbmm9FbxA1luQVX9fzco9s6exSoKdKEtT4mcdG1 zIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455730; x=1741060530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HQARWggofyARbzO1v8dhj3CLs+WsMSpSVZ/wO7/jEqQ=; b=jTYZSRuRVksXANQTBlcoPvuzVqXWMmYASvIAeRfNt2a/YEHh9GM0UXwBNqoA4pGjLz 1ctnhPKy65wZ+5h0883j7zZ4odYVxQxzN0Nj/icSlNSb68t/jvDs16Ddolq5km2VXB29 zIZE7sThloZuV0ChLmFVX2llonznhJssbv8Kl2H3kYDbICvpV3kliQOBxfbCCdzuHzr3 4A9pRxJI5aA8eMMfuciLWXimjx/wnHMwuoMXoe4rm9vmpS7mqocfppdiVZWJjP3g/7Kv r9bA4B3f4dEyWVpjP/ivC3REf7cMxA1mlgUZvkRZTZ9nPj1jtpYWdrVgWCHUcObdVmPi lguw== X-Forwarded-Encrypted: i=1; AJvYcCUHQHGk4iHV5BniZO/ocfQQLLy1sWkU6GssqO+8kWEMLwGbzxde39YxquV5TDK7w8FTPxpLfNXyvdwSlB34oIAF@vger.kernel.org, AJvYcCUPNPnyzxRFad+P/lGCOwaKDopvkDK6Lw0G3T+55kdKA3Nsl2XNbb8qy/dZUD6UafB2POtTu+KkrcCjvwI=@vger.kernel.org, AJvYcCV0+DPa/MHcoCE5Eto0Dcl/hn2A+w3kmoIwhsgY1yn16xCH+hGacgVc40iY3npM0ybgjmN5dQvUtut7ZShAI3m4nkVL@vger.kernel.org X-Gm-Message-State: AOJu0YyuZJzKvghTu6jv4Y6IdEs5GgFlNxZ45zZoIbH7T18XrGjnC6tn SH1R00Lebj7Om4bNRLMzV1kF3H8hKhys2WXzk51uiT6DGRZD2J2O X-Gm-Gg: ASbGnctRZbubu2TmhDg3+TPLWQZKVWLJwoSE+MYF60Onva6JP6tqgstdCnC8ajfP9w+ XQpps5V6YN+OM/cE0/SO1V2KegXOfDGpHt/g4o1GS4Zmhx0vHPGi+/yq++8PcEgzPAMBGwmtD31 /ve8SwSjgCJSvR/yj9vRaD2V3tR7VsrCI/ewc+HlZTeSJo9AkxJkB9TM6J23NbiYMWVpIb1Tl1+ 3s8/jZASFt8pIl4ooaxlqoPhBwDC8xgCX9aug+wARCHzuoCAtPLyqV0FO1R23AMB3izfm8ZJoFl ZEpNsNYhjDw/Ss5kc4QaZyKOcu82TnHjsAUf9KuJTAosASszbJ79wx+gy7S/huKFpSy3vBGhKkR mEhhGBSfsUGpQZEYB X-Google-Smtp-Source: AGHT+IEse+IHb8ym/dd3Pk98eVbMhrTZY6i51QAsLVcIqmgSrvsy8pR/7b123U5idbXYlGhD7E9XWg== X-Received: by 2002:a05:620a:1706:b0:7c0:aaf7:76d9 with SMTP id af79cd13be357-7c23be12855mr199242185a.24.1740455729971; Mon, 24 Feb 2025 19:55:29 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c23c2a3239sm60559485a.37.2025.02.24.19.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:29 -0800 (PST) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfauth.phl.internal (Postfix) with ESMTP id D9A901200043; Mon, 24 Feb 2025 22:55:28 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Mon, 24 Feb 2025 22:55:28 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeefuddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:28 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora , Daniel Bristot de Oliveira Subject: [PATCH rcu 06/11] osnoise: provide quiescent states Date: Mon, 24 Feb 2025 19:55:11 -0800 Message-Id: <20250225035516.26443-7-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora To reduce RCU noise for nohz_full configurations, osnoise depends on cond_resched() providing quiescent states for PREEMPT_RCU=n configurations. For PREEMPT_RCU=y configurations -- where cond_resched() is a stub -- we do this by directly calling rcu_momentary_eqs(). With (PREEMPT_LAZY=y, PREEMPT_DYNAMIC=n), however, we have a configuration with (PREEMPTION=y, PREEMPT_RCU=n) where neither of the above can help. Handle that by providing an explicit quiescent state here for all configurations. As mentioned above this is not needed for non-stubbed cond_resched(), but, providing a quiescent state here just pulls in one that a future cond_resched() would provide, so doesn't cause any extra work for this configuration. Cc: Paul E. McKenney Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Suggested-by: Paul E. McKenney Acked-by: Daniel Bristot de Oliveira Signed-off-by: Ankur Arora Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/trace/trace_osnoise.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index f3a2722ee4c0..512034e365ad 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1542,27 +1542,25 @@ static int run_osnoise(void) /* * In some cases, notably when running on a nohz_full CPU with - * a stopped tick PREEMPT_RCU has no way to account for QSs. - * This will eventually cause unwarranted noise as PREEMPT_RCU - * will force preemption as the means of ending the current - * grace period. We avoid this problem by calling - * rcu_momentary_eqs(), which performs a zero duration - * EQS allowing PREEMPT_RCU to end the current grace period. - * This call shouldn't be wrapped inside an RCU critical - * section. + * a stopped tick PREEMPT_RCU or PREEMPT_LAZY have no way to + * account for QSs. This will eventually cause unwarranted + * noise as RCU forces preemption as the means of ending the + * current grace period. We avoid this by calling + * rcu_momentary_eqs(), which performs a zero duration EQS + * allowing RCU to end the current grace period. This call + * shouldn't be wrapped inside an RCU critical section. * - * Note that in non PREEMPT_RCU kernels QSs are handled through - * cond_resched() + * Normally QSs for other cases are handled through cond_resched(). + * For simplicity, however, we call rcu_momentary_eqs() for all + * configurations here. */ - if (IS_ENABLED(CONFIG_PREEMPT_RCU)) { - if (!disable_irq) - local_irq_disable(); + if (!disable_irq) + local_irq_disable(); - rcu_momentary_eqs(); + rcu_momentary_eqs(); - if (!disable_irq) - local_irq_enable(); - } + if (!disable_irq) + local_irq_enable(); /* * For the non-preemptive kernel config: let threads runs, if From patchwork Tue Feb 25 03:55:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989243 Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B87E81925B8; Tue, 25 Feb 2025 03:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455734; cv=none; b=AN77+GdwVVdkRXAumOpPP+8tM0vOGQu3Yie1M4nmfmFeb3Q343dKPMVOH/+h/dQQLNWjPn4BIyXp1zEnX6J58NkX6TXvz6XzHr8wfLhJUw7GrRClvtt9uGDgOxVeWRLh3kw9myGL3T3BdqOdVoBrUm3/79y6i4DZ7aLM09tXeeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455734; c=relaxed/simple; bh=1tDISaYeQ3S03meuTtLRl+xFGXAMQ/cviepaRDjCquQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FWDd2umhBHjDYXCY4H3IKepyW4LVWCq0IBpU5T0P4K4PwPPR8paXOYWrd2iFoGzuJ3zDeE2b0e66ussySthFQevEygNOOjMupB6JQ0xfX1w+jRmSwKVuyISRL6urD4RYf4VSPNdmaHK5BILKeAn8RSUrQj6VYlVot2pXVXo9ehU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OrIJTzYP; arc=none smtp.client-ip=209.85.160.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OrIJTzYP" Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-46fd4bf03cbso82720761cf.0; Mon, 24 Feb 2025 19:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455732; x=1741060532; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=9YYDq/qQc7Ji7bn3SbKnVlJKz11oqy/6rCNHG+ssGTA=; b=OrIJTzYPNtVw121sqywg+5NZlAjri0KqaMtXOwTLb3E9p0zBWVjAbvFjGI5HE3N1ds qc9RVunTXm2tqkageKLrZECBa9pziBQtBWHrGXGzAfhWLYxcf2ecgitPrwx2bKXaTiq4 gDWVjV8FdWFW3vg2wIJj/BXuU5tSs9A+EIz/OO7VAmxzi2u9ZuWQ1VwwZV3b3SgQctyC ZAzYJu+NFVToYSZuosAdcl+GT7wbFTD2VQOF5wyjVBdrlvijeDrkd3YItUcRhuEAEtwW 8PDufQqumvpiA7mVFgl7HGPWi3OTcbzG9wmGjXsMX7YFz0EphJ+7cGLMfvLmL2ljKBD8 HuOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455732; x=1741060532; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9YYDq/qQc7Ji7bn3SbKnVlJKz11oqy/6rCNHG+ssGTA=; b=r1IcbLSCagZ8DvJJN3sjq1XURkPWb0RNnTexlwIJGL/zc3rxbKdl/MXUvWoa4Tj3Vo krS2BX4jbi46TjHmctnMOgbJLRSyef/1OXXcmGaGgrdvC21T0QqUSgnn4+KdfdfSGJNY SeRnDrEXKcF+yWob0TiZUDLt8WV3ep04oLV2t0m4GImPpp5iRCB9RtRS2M2GTGG5Jc58 1fISA5W7H6VXVwJN386qwObPHxHmN0fIHy31raWB7rdAtMJ/aUwXOx9w+4KF5uG5yt5F lOhq67XvELjqL2Sh/M83/FkHCMGkehw2+4fhtKOX0M0FBh5prVjQordm2Yr0d7LIXx9W A/EQ== X-Forwarded-Encrypted: i=1; AJvYcCUw0leKEnOryB3jvuRdKTw8Z59MQZ2QVKzDhKJV0rG3rGgZSr/OXMljw1p4inXFwf26rD48H8fQdTM3jBI=@vger.kernel.org, AJvYcCV6eeuWcv8j7MXuSypX2rQYCz6c4pXjQ6OVEIbeoCe8Ukv9F9BiR+FRQQ6E7sgQT+OOx01lw+LNGZFNZ7oTOmcCcRop@vger.kernel.org, AJvYcCWpR1HU8MUKAdsimATH8AbKF27kNVJG/um3ui5kZIenYirauLvPO4CZoJF0MR1fVpMuA7j4u4T/04IZmm1xtFHA@vger.kernel.org X-Gm-Message-State: AOJu0YzAgbMhsPnlmLfFjeOzRqX0NHYHgkfvaTbMKsitsy54JYIlTqlm rfZhMMBodem1fvqX7pVDmysf89tgSgeqdGYpQPw3Or3qB3ffp8bD X-Gm-Gg: ASbGncvE3Dia7UawkCAabKVtIYZ/3SXy5TA5QSYlIhDaJiFizWla1gfInGTMhn2kyK1 U0GJL6FRCFNJQvFgJdQQSKdze/uVekWcAvzsGWM+hHZympbe2VXiWKNzLpvkUpNmbrBk19DTRyY rxVdYUm0ZVyX+584Jr/kW8QUo46Luq86qRucVEKXqTgD+6DPNjjyX3Ziy0XDrCk/mS2iyo8lpfG 3NR2PhowAScO7PILRmPA/DFOdgtP2DC09/ETi0y/4ntj+ojSmPoYdzTiNu/kzAjDdENymLGblgN iS/Gjq3OLNWIdGgT7gMfvIUf4tutjmMZ4eeHBYGdtu4wmOjINnUZTgUQTbFY7Oy/KVocEWlMac9 SaWwoybEGLvXlJc5M X-Google-Smtp-Source: AGHT+IHMXuxSGfHeFeWe6ixvXP5jkriSYpqbZd+mVCI6P3K34NPERaJ5lBv6YBRO/9abgXR/Xk5QdA== X-Received: by 2002:a05:622a:1ba6:b0:471:ffbc:9bf with SMTP id d75a77b69052e-4737725c824mr20978481cf.40.1740455731579; Mon, 24 Feb 2025 19:55:31 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4737806a530sm5087501cf.59.2025.02.24.19.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:31 -0800 (PST) Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfauth.phl.internal (Postfix) with ESMTP id 556261200043; Mon, 24 Feb 2025 22:55:30 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 24 Feb 2025 22:55:30 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgffhffevhffhvdfgjefgkedvlefgkeegveeu heelhfeivdegffejgfetuefgheeinecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhn odhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedqudejje ekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhn rghmvgdpnhgspghrtghpthhtohepfedvpdhmohguvgepshhmthhpohhuthdprhgtphhtth hopehrtghusehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepphgruhhlmhgt kheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepfhhrvgguvghrihgtsehkvghrnhgvlh drohhrghdprhgtphhtthhopehnvggvrhgrjhdruhhprgguhhihrgihsehkvghrnhgvlhdr ohhrghdprhgtphhtthhopehjohgvlhesjhhovghlfhgvrhhnrghnuggvshdrohhrghdprh gtphhtthhopehjohhshhesjhhoshhhthhrihhplhgvthhtrdhorhhgpdhrtghpthhtohep sghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuhhrvgiikhhise hgmhgrihhlrdgtohhmpdhrtghpthhtoheprhhoshhtvgguthesghhoohgumhhishdrohhr gh X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:29 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora , kernel test robot , Joel Fernandes Subject: [PATCH rcu 07/11] rcutorture: Update rcutorture_one_extend_check() for lazy preemption Date: Mon, 24 Feb 2025 19:55:12 -0800 Message-Id: <20250225035516.26443-8-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" The rcutorture_one_extend_check() function's last check assumes that if cur_ops->readlock_nesting() returns greater than zero, either the RCUTORTURE_RDR_RCU_1 or the RCUTORTURE_RDR_RCU_2 bit must be set, that is, there must be at least one rcu_read_lock() in effect. This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then RCU's cur_ops->readlock_nesting() function, which is rcu_torture_readlock_nesting(), will return the PREEMPT_MASK mask bits from preempt_count(). The result will be greater than zero if preemption is disabled, including by the RCUTORTURE_RDR_PREEMPT and RCUTORTURE_RDR_SCHED bits. This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel. [boqun: Fix the if condition and add comment] Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202502171415.8ec87c87-lkp@intel.com Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Co-developed-by: Joel Fernandes Signed-off-by: Joel Fernandes Signed-off-by: Paul E. McKenney Tested-by: kernel test robot Signed-off-by: Boqun Feng --- kernel/rcu/rcutorture.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index d26fb1d33ed9..280bff706017 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp, #define ROEC_ARGS "%s %s: Current %#x To add %#x To remove %#x preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count() static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq) { + int mask; + if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE)) return; @@ -1902,8 +1904,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, WARN_ONCE(cur_ops->extendables && !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) && (preempt_count() & PREEMPT_MASK), ROEC_ARGS); - WARN_ONCE(cur_ops->readlock_nesting && - !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) && + + /* + * non-preemptible RCU in a preemptible kernel uses "preempt_count() & + * PREEMPT_MASK" as ->readlock_nesting(). + */ + mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2; + if (!IS_ENABLED(CONFIG_PREEMPT_RCU)) + mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED; + + WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) && cur_ops->readlock_nesting() > 0, ROEC_ARGS); } From patchwork Tue Feb 25 03:55:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989245 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CAD82566D9; Tue, 25 Feb 2025 03:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455737; cv=none; b=KqfqRLbo1kyPwIVmdIytBnZgSvi3ln9A6YWCHqgTP0+Mv6c3YfAMRLo2qm+KKtZiG4YYyJq3SdislqpUfBmmjJv1NmjciI8sYg3RqruPHw1a29aK94PJryoRDQDGwe/coGNG9HvQq7QsXxFGuF8MMNUgoiHPWOczpaIiLciOnpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455737; c=relaxed/simple; bh=lypcfpF4/N47ol4CwHDwwB0rg0jxZ07VELUbrb87mhE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PrCrSvKRSCckUKNhdgsL4fd2WqelcNpZxRI3M0cWzS4i1IuYO5YST2MmBibMR8sCbwxgP4F6drTsqQxX1eSkoMMDiKm9vvlJeFmwhGzOoasdrypnTjoXgrodHWB1uxnQ86S+ZnIUO8buVgJj9MrBrBdppuWqRy6/7DhQ7aOdnsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KMHwwhFZ; arc=none smtp.client-ip=209.85.160.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KMHwwhFZ" Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-472180fec01so49122431cf.0; Mon, 24 Feb 2025 19:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455733; x=1741060533; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=h419Jx9H2aghJLfc8GQxEdkY5w4iKmNadb4INpgW1eA=; b=KMHwwhFZ6Fx9oElOCGJpmypR0h53HRAa/leq9vXuN+yP+X9RC5jC3hcxRgovBQ2QbE Qtdk57innRStYNDX8uuVpN+19RnXmJInRiEqMGM6m8WOuGlHVfvnOB+UGbFzhoaoQgfx B1BmmxicgsiVTKtiDrjZ9k6pmX0F1OtQPQ7dmS5s+DISS2jUT6GkU8oHtmnaN3DKe6Ub ZYWU15x+lpN+jhHyF2ZwANCF+Lf2p+fmzn0HCIFgLIcThvsod+ueCBrOeUjKj0rNDlku Ob08SrwG8JZm3qYhJ/qMxfPfbfn4RAKoF+/ufGYKyR0leMrro6km/Pa/yGMj29tVgkNi GHAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455733; x=1741060533; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h419Jx9H2aghJLfc8GQxEdkY5w4iKmNadb4INpgW1eA=; b=f2Cd9nk31lp88etDV9xVd7Dmbi33TJA3sZOWWuMPsPyB6+kZ2nv3GRn1kJY0bpAFUV aguY2Yw4ZZJGeGU8ckhp7AIaFYst8sVOji5TaTrW1X2uB7drNjdJdBeLe2tHGQhIIkwL PGrp4l2+pT0lGFrUQf8RWDFgKEQNzTN+0mMAZK1cXFt7sYamyscP8Lg+hW/zoVYKoRpx OwHd4DdGqzCjPIPMpn1pO2HMzE378fwcniOL2/FMQAI9h0xi6XAhBSaSkUTbxRyT6o2J Zt6YwDzkE+FTSUAH4EfB1l8zXHRrpWUfQLSBCaEn+JznUA02JPWmxiGZaMTUIRCAKAsI /8zQ== X-Forwarded-Encrypted: i=1; AJvYcCVMwlBXPHLiKIir8O6oNfV0SVkl7IsvTAixpE1rF+fV9KEf/RPB6gytlMBb8GRv+LM/oB1Dt+4K6rNMcKJAEVwt@vger.kernel.org, AJvYcCVgAO+n1W260wE8cODvF9FDuBaGmX8OPrLBmeAnG6ct48EOGrCxVo4jY3iSRQi17XzzOuMvHG11KogiP7E=@vger.kernel.org, AJvYcCWN523XRorrGTkFMlrlC+hlEQa0FTv9aJDK6j+ILlAqFwzYktROCE42hh468h524iC5K19XqbYItn0bSlQaNp6e2x94@vger.kernel.org X-Gm-Message-State: AOJu0YyuExUfPoYMRiJq91vzvXS3ZHJynkLnw//y9xLOGuHosiqrcTxa khSRxzVQOZBYH82GoOUXAaFdQGbw5TS+xclQfwYrX730yP59Aoqw X-Gm-Gg: ASbGncvNph92YUZ7OcpXb3yqONeAEfBXi5dlnvWo3yAsruqvbup6z5YMooGAuwuRX3R jN1Vq6bIZUg4NJBYQLG9pUIrF2LMVR3OXo7ykF5c11Ax7c5YBqHIgNhcG5N5K504nlVFfmU2a7R XLPvBtN8yFo8lP+2RDR+OyVHMhAxFvYwS72yVROul39fgCrAwlOI/RQx6+OG5t4ca+xzDGPb+DT NYBLNA8K/62YgXqpfCkgVMdWt9exJOS9MJoFfwDviPYFdAaflgaLmLWuNtqar6GTjyVyQ6NY0cm wX+SSxtCI3+gJccVrTaLm0bhxRASY3TPcuvItfqK2NRbBxZRF7PKl5RPQb28Tz8mip4N39xFwtt CXYknTHBnnPFgF59h X-Google-Smtp-Source: AGHT+IF1bw2/M4rJe7oPlREsRl6H7CKb+zSI/4ZcCobx1E7yiXEWmFhjkYKWpWSFZOo7fD2ufyGkCQ== X-Received: by 2002:ac8:58c3:0:b0:472:744:e26d with SMTP id d75a77b69052e-47222944f84mr224990431cf.39.1740455732873; Mon, 24 Feb 2025 19:55:32 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47377e24400sm5295041cf.41.2025.02.24.19.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:32 -0800 (PST) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfauth.phl.internal (Postfix) with ESMTP id C8CDF1200043; Mon, 24 Feb 2025 22:55:31 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Mon, 24 Feb 2025 22:55:31 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:31 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 08/11] rcutorture: Update ->extendables check for lazy preemption Date: Mon, 24 Feb 2025 19:55:13 -0800 Message-Id: <20250225035516.26443-9-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The rcutorture_one_extend_check() function's second last check assumes that "preempt_count() & PREEMPT_MASK" is non-zero only if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED bit is set. This works for preemptible RCU and for non-preemptible RCU running in a non-preemptible kernel. But it fails for non-preemptible RCU running in a preemptible kernel because then rcu_read_lock() is just preempt_disable(), which increases preempt count. This commit therefore adjusts this check to take into account the case fo non-preemptible RCU running in a preemptible kernel. Reviewed-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/rcutorture.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 280bff706017..4cae119dece8 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1901,8 +1901,16 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, WARN_ONCE(cur_ops->extendables && !(curstate & (RCUTORTURE_RDR_BH | RCUTORTURE_RDR_RBH)) && (preempt_count() & SOFTIRQ_MASK), ROEC_ARGS); - WARN_ONCE(cur_ops->extendables && - !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) && + + /* + * non-preemptible RCU in a preemptible kernel uses preempt_disable() + * as rcu_read_lock(). + */ + mask = RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED; + if (!IS_ENABLED(CONFIG_PREEMPT_RCU)) + mask |= RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2; + + WARN_ONCE(cur_ops->extendables && !(curstate & mask) && (preempt_count() & PREEMPT_MASK), ROEC_ARGS); /* From patchwork Tue Feb 25 03:55:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989244 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5112255E4E; Tue, 25 Feb 2025 03:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455737; cv=none; b=omfo8PepqzB1fmETXF/xuy/SYtvnmyqzqrfRVT23jkiLoycpbKLC+YwaBCrHTdT3nQTFXx55j/bi8HL8VjGfZj60xhu3pYFnVwyBcAC5r22feQezEbqNqmFZGWdYPLPqnEx0IOhAiTycmDlQ0jQGx2y+3IvpLb42GsM8XOY3EHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455737; c=relaxed/simple; bh=tmww1+SJua+4wlLpPC9mhEo3DKU5TCZTK6AeKQiu02g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Amyf7vEe/AB95M7uP0Rl2eey3/Lppocf+NJ+Gh//azPFrxP1uomgcqJwqwUgiAhXf5pz9CRu8hDGYflx8/YjFLainufbfMM4kpWgBqDvAjQuJyTJ5jPCv228RGzAZHfEIa/aKxYHiPgiBrwBpxmmD34WRnP3QZHM2iqvTWjeOIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WacBkQSY; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WacBkQSY" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6e660740061so46365166d6.3; Mon, 24 Feb 2025 19:55:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455734; x=1741060534; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=9uLvu0VnuSfBzmKR1xOZZZMcPxk+1xKCMKGMXIs8E2g=; b=WacBkQSY4Qbr8WiEcTJSjw3qb4v4HvC01Fg4Leq4Lzk1zKnWS4k72SuUz9feTX6V+p yimedAUE207rhIVfQF3JSkhWDslNvd5vCHJwOKCtjA8gyyKOV8NnHIL7WZqRfyIOXeL4 lP60ulRvV0qEzAFMIGtElDcsfcBPRGK2FbHfyTRAmTrQReEXvcm/TpCaRxzKsscHWFi4 pTo5cRhHmSn26vKP8HqDUvWKezrBy5ic+vpI0VEMvvlluTLnfPY2DxXzHyVg+zHfvenO qEjGST+WOC4+lQSNkI9wJN8ezyUYykDlPI/xbj9ytRNk7uiGNLZZiD5pnjDMYbyO12Qm dCTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455734; x=1741060534; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9uLvu0VnuSfBzmKR1xOZZZMcPxk+1xKCMKGMXIs8E2g=; b=EAc/0+bkc2O19s9/LjV3jLj5240hfh2EYybByTfz8v8H4hy2RWiK3qXQt0MyVAULOP IfGscb2SAqB1kcv4AkW0qlkFEQHDYIQ13OZRAPY01GiECuxAw30E8yKrDeHHNX5rpYCo 4n+eKAeKhz92wVjzUFSt3x5plLdUhgmu13uAt5qN+yRdOiXITYFqwumzE/ZNUxFdJEzG RljCFOBqxJYI6s+HW8XnlPMixjDX132ylFIWwD7IurkUTdcai9klUg7OlcAUYRjkpHkf Sb1uoGXiJKt0AhwUYrkhgFvsh3WLheMUvrj7/pro6pMk+sjMBcGR964G+hXkkZFK2ttl WpTw== X-Forwarded-Encrypted: i=1; AJvYcCVA37CNIEtkOcGucfL8fsfrNM8YJVX0TvQPcbR1IrC6Az/M+aHKxSu9Nlll2WBndrgBEagxVbziN9a0PIE=@vger.kernel.org, AJvYcCWoNJjMWkUPASRu0hpRK5MHYZcjQJhTvLXMICFeZPz/sPvdCEbkbPsp6AN3SRfytcBrb0JDt+4p6LIOGhwd8mHV/jH4@vger.kernel.org, AJvYcCWxUr15q7oBLldPbjfhDvTjP9UEkVJI5e6oZuwMTv99FVx+RLGBWRDFBX8Pk8eiDbomFKJf3poqazgeKDbc7PM4@vger.kernel.org X-Gm-Message-State: AOJu0YzyP5HGPhl3WKbSULR7dzETeeagHITOpxlexeNRS31w3zGRFGv1 W623NBplR+Ts42Vqn0ceWWOzKUcbSmGf0UXx5Rqo89PcSCBbbYy0 X-Gm-Gg: ASbGncsWFNZJZA9jYV3d+yk78obw+xLoMk3Rl2ozkJnH+AsISUNHAv9QWBXsGoVcFX8 cPKuaYo0AzeRBAq3UWdBh349Z2CRwQtvEACfWB/dzt3P9KoYxjpRpOLetV8HWyoPfrd4Cz1k7OC f34XHrQA/kYpmxRM55G/TrqemnDoS6IPusPzyY33cNRV5sysdVSGCBcP9RiI53w8ml2oFPEvb0J FhOpx5OQC4iwcsKWZLgfA94IFG98QCuqiSIG2ISvr73aqXJo9vn8jofMvG9AopH3fvnCsKa/FKt Wisd/TEuL+v0v7dj6I5v8o57nQJ3lHjNtcMxvoSTU3boMGJnD+DvdOhIPoHfj31W5kl4x22swVl D2d80x5wTL+cvklQM X-Google-Smtp-Source: AGHT+IHYqFDwVuL07beYvSc+yBY4v+L4a9R4xbWY8aepATv/v35vL6NgV1lYDMvgzLPG6DxzRx216w== X-Received: by 2002:a05:6214:5190:b0:6d8:8109:a547 with SMTP id 6a1803df08f44-6e6ae829130mr225550176d6.22.1740455734598; Mon, 24 Feb 2025 19:55:34 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e87b153fc2sm4985826d6.77.2025.02.24.19.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:34 -0800 (PST) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id 481D81200043; Mon, 24 Feb 2025 22:55:33 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 24 Feb 2025 22:55:33 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:32 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 09/11] rcu: limit PREEMPT_RCU configurations Date: Mon, 24 Feb 2025 19:55:14 -0800 Message-Id: <20250225035516.26443-10-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Ankur Arora PREEMPT_LAZY can be enabled stand-alone or alongside PREEMPT_DYNAMIC which allows for dynamic switching of preemption models. The choice of PREEMPT_RCU or not, however, is fixed at compile time. Given that PREEMPT_RCU makes some trade-offs to optimize for latency as opposed to throughput, configurations with limited preemption might prefer the stronger forward-progress guarantees of PREEMPT_RCU=n. Accordingly, explicitly limit PREEMPT_RCU=y to the latency oriented preemption models: PREEMPT, PREEMPT_RT, and the runtime configurable model PREEMPT_DYNAMIC. This means the throughput oriented models, PREEMPT_NONE, PREEMPT_VOLUNTARY, and PREEMPT_LAZY will run with PREEMPT_RCU=n. Cc: Paul E. McKenney Cc: Peter Zijlstra Reviewed-by: Frederic Weisbecker Signed-off-by: Ankur Arora Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index e2206f3a070c..dd6251678e99 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -18,7 +18,7 @@ config TREE_RCU config PREEMPT_RCU bool - default y if PREEMPTION + default y if (PREEMPT || PREEMPT_RT || PREEMPT_DYNAMIC) select TREE_RCU help This option selects the RCU implementation that is From patchwork Tue Feb 25 03:55:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989246 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 228281A2393; Tue, 25 Feb 2025 03:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455738; cv=none; b=Ys5hRy86luALhxh/8/rESmXI4xezZR4kXxfrkWYIJL0+F0uyyN35piErYnvqh7m4oDq07u+UnB40iUc3D9YA2Yi115eXxsqDTlEM4/GY3V4eLsHOEGqI+ERGbnk+bx8bbufVFFvHYNeBUJBk4zzTHwKxUkcp15VWRtITWOohwrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455738; c=relaxed/simple; bh=IhkoHcLkUW1HTDPz7nFHSIO9D1UaWcIW0uk1mkBzn9E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y+Nzf2lW8a+iZqdBgOweYN4UMzWF3vzU9kFZE7sUCQtjdyX+gPAvjMqglHt4O2zGKnk5HiHhuPGoS0/695aW5ZpkTgOmE1tuVdYDJ3mExqZBJjwx+RhoKFUgZXJT6IUpjMhc+wQlqymvUHde3OhbU96VU0oHqaLszHlbc1kd338= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z/wtI3DN; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z/wtI3DN" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-47210a94356so41102451cf.3; Mon, 24 Feb 2025 19:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455736; x=1741060536; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=jXC9zawY7wJtvjckwQj8TFr/iOcB1jE0LV9gQoKP54I=; b=Z/wtI3DN4HZIZekchGXDUt8SYb8oSB0KavIddHY7hZdL52WgOlDWbPZ4KJv0j35C8a +g/CwJv5bWzGPNG1BCcMim0oM9c3rdnTGPpqTbLzkKNYOzLyBN/k1/ce3I+hqm0ZdfNQ WYK2wEoS0kveuR0K+DsGMaPCGbn+FcYoA26N474N21w7myJiJWnJEz/NdXxWleVOwUkk ZohglnebcMS42xUeRl9YwrHKoeQPH57NpyT1GxID99RyDERfhWjHa0tbn/1BYm6iyXRe gu3bDhqcalccOrlZkUNb0UY0oC2w3EZQkNCzZn7bF/pqxr9ddSpcFrOjPzigy614laTY oStw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455736; x=1741060536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jXC9zawY7wJtvjckwQj8TFr/iOcB1jE0LV9gQoKP54I=; b=LnnGWzJAA7W764Jqq88yf71hKAhgjSmoTl//5cZsobBYtOqHufZksYiyAAzpZlrLyp vHew8YLZbQT6k7apa8J0XUv1zVI0U0ckS6ncj5nVVeHjpA6ejM1iH7IzNWzVhzUbrTax QhTB+ddMLFjFsXGI1dhWDkOW9YvzDtk5LVqDFOmMiAcQCuuRNLuC/n0auK46C8RjtIxN b3tCcPGJceoJUzzDKDdytRHDJlu4L6slLN4sMk7SjP72AbCg5YN29RULoE1UxtKrw84z or3Ova0+I50PWlSI2vGuVjjnkbwrGvYGfstknRgn7BghrbooDBW4pq3kVgeyKnQeSAm2 gVQw== X-Forwarded-Encrypted: i=1; AJvYcCURexsYCQpLZET/cu8KJgyvRwGK56SBAZqW1p21CQ+/7Bn2sIsOd/jpq9zVJBZfCeh3nOJOnUKgwW+ZJ5YN8+7F@vger.kernel.org, AJvYcCWFQ+3/d8Ah+kzYgkbLB3f3wqSF3okeWa7i8Kc2yv3EGYRo0fXVHhCMKcudad9F+rNHUYn6ffMWS4au+oA=@vger.kernel.org, AJvYcCX8de0PolR13KyrNp/He5fbGZHH/1Kh8lICZnNV3bScpjsxbXQWqHCsF6Szlr0oT1xcWKI8v5ie6CqDpBKi7N31yFtK@vger.kernel.org X-Gm-Message-State: AOJu0YwKsSa/LzZtKJut24xR2WPtcEi64cSL0N4FzzlDR/mflWApwJ+B kBYPHudXai3X23n41PSmBuci45d0uAyJ98YyHgT7UlGEHzVETcVw X-Gm-Gg: ASbGncvam9mMEH+1ThIB+Taph4rmq67kcaK7qDvO2D8lCZ+12OKBAysp1KX+F0UQa0D tenMhvOT7OO8P87eL1JHEZIUyWpch1CUlz5RVFBJzgFOTX2RPLsDVQoa3Y4DLmTy+UnXHohK7ez AqiTj8kbb66DwaGiVEqbsboZSq5kOALyQpDY76s9slMkKnkcmhDfTTErwGJQPYFLsWK1mjc9zyG nBa7zWpB2jBUXJLHb1KYwsZAKjFwNXaiGZgk01o192Fj0xX6B9iRumSU1DWIT09YgaJg7Tpf56Q 3gSkGX062GJTFZcMjgho04e2rIRYbkMxrC5bOL8h+sRDutYWUk8/XrBttMNreI9bfE4ws+jQXrE f3CPmx1STilPJys/+ X-Google-Smtp-Source: AGHT+IF0ja1Sg/mWiJyMe7MASVqniJnXWzUOGt9oWixkxEnaidRrfPol1LofMc9zJH82mMa3+AMz3w== X-Received: by 2002:ac8:604d:0:b0:472:dff:37fa with SMTP id d75a77b69052e-473772707c8mr22740771cf.47.1740455736147; Mon, 24 Feb 2025 19:55:36 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47377e24caasm5271531cf.47.2025.02.24.19.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:35 -0800 (PST) Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id D024D1200043; Mon, 24 Feb 2025 22:55:34 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 24 Feb 2025 22:55:34 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:34 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 10/11] rcutorture: Make scenario TREE10 build CONFIG_PREEMPT_LAZY=y Date: Mon, 24 Feb 2025 19:55:15 -0800 Message-Id: <20250225035516.26443-11-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit tests lazy preemption by causing the TREE10 rcutorture scenario to build its kernel with CONFIG_PREEMPT_LAZY=y. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- tools/testing/selftests/rcutorture/configs/rcu/TREE10 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE10 b/tools/testing/selftests/rcutorture/configs/rcu/TREE10 index 759ee51d3ddc..420632b030dc 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE10 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE10 @@ -1,6 +1,7 @@ CONFIG_SMP=y CONFIG_NR_CPUS=74 -CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_NONE=n +CONFIG_PREEMPT_LAZY=y CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT=n CONFIG_PREEMPT_DYNAMIC=n From patchwork Tue Feb 25 03:55:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13989247 Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFDFB256C8C; Tue, 25 Feb 2025 03:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455740; cv=none; b=BQfTjcJjmLnHxa6cw84/rhDAcOHn+qtanvJ7ydh9BWA3W6F49FmGVd4rDm6dr4LbixrMp+bHoGyqbUnvzCDfOCpcEIhA3algm24hF8YY19o4LjV8+czkvZEFElQ2UDddu4clpvyxkTgW6KMrxEV4Me+zSqBY9O9llNgvwrr2J5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740455740; c=relaxed/simple; bh=hqCPdIph2mEXGKw96mZQH91SjWkRnJXKURdGMWJHfS8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bgDWJBtxuZc3ZcwsPCR4S2KoR547JDlJZWlhamEoWthMWmtA0YyGijdCtqy74H3p235OXVBn/EDgKriiA7tF3WbY28do/6wf1MW1kWTydxFDPBA3IWAbz7peUui63fduP1aWK0wBKFlvdECrhnNnAQnvz0oFNVnHoY2NBt4b7Jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OJs3X768; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OJs3X768" Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-471eb0e3536so78830541cf.3; Mon, 24 Feb 2025 19:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740455738; x=1741060538; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=PqEV+yYJyqQ0AIRDTVm+hLCdqAfJYbttiuL3CvWulpU=; b=OJs3X768dAQC6CgGqZZi7i7mspSXe++mJO2rFfPctqV1vhgY28aDbr47A7fpNOYx5I 1VqKm2QHqfeBz7EWXVCD53NWFiDWqxKLm4fO9syVpU++DfmkUHn5dkDeaiw51yXcaPgF 32/WysFFP+VzC57Hi2vLQAGwoxWXpbHfWN7Dn+V+sG6FYRpEw3JAW5ULVUVTy1p6Hae2 fHJjaNiLFHSWSPUiRJg8clnPMiOXjadn1Gjp6invEYx9HoK2Ubji83nYDbRa+iTE69TQ kRjV4VvwN9T2Wq19gJq5v/ZG+CT4v6rUJfrc1LtxqO8D9oH0RRfBTS8atqnsayBnQfUm fRKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740455738; x=1741060538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PqEV+yYJyqQ0AIRDTVm+hLCdqAfJYbttiuL3CvWulpU=; b=KFE9/QgoPHo8oxPY9c6/dR7C4d+DlsA4g+tl+yxSbtDQgvjWVBWMy0muUumtKa1bC9 rqM7laFvNRs764YhN58x1f/F0aun7Ur8c2X6RrPrpPtbfTdZpfzpA6+za2PCSiDWnr90 n+wybk4DMLIRagrPNLbC6N1g0XWZkp7tp6oPJ07YKdkX7V2Ng23AQN5mJpnZptYRjibW LluJ/msfeAyL2w/+Yxdid/JVjv0h0O7d+n4uHpq1LUhrfBiw2WdE8UewUswz3vvSiUaL 4NYFq6hQJyJ72CZPc3MF+sNEM7dAUzPWpcSQ50xG4+pXOMFH3KyjnE3k1VPcd6HNGS32 lurQ== X-Forwarded-Encrypted: i=1; AJvYcCUlx4FeRUm1TPtgD65oKk0iwwTt0EXM1QcJyJshh65XohXp+EVu6dRI5OldhtiFo1g4Ua1Dt/0jqFtU6lg=@vger.kernel.org, AJvYcCWs290I8NBDw6+WhtthEn5+3QMDPJ6KZR1loX4Z8UXp27wiWuVCpi6CRpQDaVmIkKNlL2nwvSBhk8OnFVQZA8eA@vger.kernel.org, AJvYcCXLr64yp3T15y1IdT3fYRTZsa8Qz9KikJFhDnuXd/nO4FyRz0WpW43hNJ9++rq6f690gymaOatOaNtrr0wdLxV1JQl5@vger.kernel.org X-Gm-Message-State: AOJu0Ywykmu8gVtls+DZpu1+6cyIE0hLuo9hx2iS/eLaCSabHfAE1p/9 aP0S7Yif6S9c2P3Q61hY+wJ2KvE4Hbd2srEDsM/WBq1iiQ4B3upa X-Gm-Gg: ASbGncv4WBc0R9oEFBLyXGL72GyyhwRtWM6mce+Xlh/TExwwrvUwmBdLMVB+XK0bZza dumWCeOLo4Uuc0NgMpVSrx2nV9rUwbDsEM+VJiVfk5PvA4y8RKW/jC0HWn+18/A7qVFYhv9OaPs mrVxyUvAmvWXWAalC6Q3ttW1aCF/EbzeP/5FxVYT38qxQ387za7b39yfBhXKbeGt3dMHmk/qm/f r7vH5pg54gYlF/VfUuJ34Qq2p3q3akrEqhk/WZ71Xok+TIzG6n1DBPS1wDo2xkN4uZz33yQhRYL Y2s9MONBGVoTHpDeiB5/Ss44m6hdl5P/ALWWUkBGRJwy3G5e4V4/KjT2qk11o9GRM6PFwr/rNSz IUxC9enzhYaJeK+sc X-Google-Smtp-Source: AGHT+IEyu+HpjxoL6jLdU8QlNCqQMreXwroF2Gy7vXziN5drHf/L9XWouCuyl5ZeNAVe+tBWLmGsbA== X-Received: by 2002:ac8:5f8d:0:b0:471:98d7:6f52 with SMTP id d75a77b69052e-473772292c1mr23391531cf.27.1740455737638; Mon, 24 Feb 2025 19:55:37 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47378093f75sm5077551cf.81.2025.02.24.19.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 19:55:37 -0800 (PST) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfauth.phl.internal (Postfix) with ESMTP id 54C521200043; Mon, 24 Feb 2025 22:55:36 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Mon, 24 Feb 2025 22:55:36 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektdeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeeftddpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 22:55:35 -0500 (EST) From: Boqun Feng To: rcu@vger.kernel.org Cc: "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Davidlohr Bueso , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , Masami Hiramatsu , Shuah Khan , Sebastian Andrzej Siewior , Clark Williams , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, Ankur Arora Subject: [PATCH rcu 11/11] rcutorture: Make scenario TREE07 build CONFIG_PREEMPT_LAZY=y Date: Mon, 24 Feb 2025 19:55:16 -0800 Message-Id: <20250225035516.26443-12-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250225035516.26443-1-boqun.feng@gmail.com> References: <20250225035516.26443-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit tests lazy preemption by causing the TREE07 rcutorture scenario to build its kernel with CONFIG_PREEMPT_LAZY=y. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- tools/testing/selftests/rcutorture/configs/rcu/TREE07 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 index d30922d8c883..352393bc5c56 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE07 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE07 @@ -1,7 +1,8 @@ CONFIG_SMP=y CONFIG_NR_CPUS=16 -CONFIG_PREEMPT_NONE=y +CONFIG_PREEMPT_NONE=n CONFIG_PREEMPT_VOLUNTARY=n +CONFIG_PREEMPT_LAZY=y CONFIG_PREEMPT=n CONFIG_PREEMPT_DYNAMIC=n #CHECK#CONFIG_TREE_RCU=y