From patchwork Tue Feb 18 05:45:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979050 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 3895C1A9B48; Tue, 18 Feb 2025 05:45:56 +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=1739857558; cv=none; b=eoNKKUOpPQf3WazKrWcSxUFvrVxp/UibZd/QK8IHT/l00kn8K1s66ImF4KYCcogMbkCpMoEebwF7agkO3fnO8QSHuOFWdS1wn4hqFMH+bGqxq05ujXgZRqQ+KQTkLPHiFWfCJw7Qpc7Ovsp1gIzFohQii8FJBHK7r5vlYc5Y4jc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857558; c=relaxed/simple; bh=FNC3ESzhdnefYnWfGSSwUKkIovsievffBMv39YwMHyI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LM5juGzzpTihD4L781EESYwbvKLmCJWHzdZHee+rM1SeOOyjMfPUY+3zsH8XLx43B9mW4vwZyMEMOjnxW4GGwHRq8jei/wvDX+C1K8scE6sTG9ytIM0GPvYpp6Iu7pLDYydnJNA7jDlqEUQIIwtyyMj2Oh0IYrv8czUWE/1yPUs= 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=abBUv83M; 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="abBUv83M" Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-471b5372730so65654621cf.1; Mon, 17 Feb 2025 21:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857556; x=1740462356; 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=8900xQNk0yNWl72dpFSe4bBu/GJDB2jdwCOQg6tQUXw=; b=abBUv83MDooueHrx9Q2eCGL5aSs/VmWW5L+pTF10fI0U6KO2Q9zlBlua2aVXIRS5ig OLK7907GCbQLrK2qJ/lLECGAfZk7EphhhX/gOJv/BU2bKMVYQ5A/63TY/+3n3ahlg0Oi keks7djY/Ov6E3j5dQUAP20pdQsjnvo1vgsteGaxQiSFzbAGr+oeEtS/lo7Qs43Ry74E i3LofXYAn/BiCvktTsSr1Bl2mjLMqfLkQaNErIhkl0fdPARC2bctAt1btk+hELGnhU/+ WUqdU6CAzV79ejKS3EDYp5PiENlUO+Pg+HR8Xnv50FvepNLIMrMeicHdHCDY8hiiwOqi b2zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857556; x=1740462356; 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=8900xQNk0yNWl72dpFSe4bBu/GJDB2jdwCOQg6tQUXw=; b=CVZX+abpUvb+mAgBIXbOeNBLRnIaWU/+NTHIhrFnx2P5vYtKMD+YfVLEpRoybBx2GZ yfTrSNgGAH26Is5QsYSNJYe3XzGRSplI4dJ+WCJ6Tf2s16nXsLa86GgER11Bk+ExAwOi 3AZgHH4QOaJTM6ZEPFVZ5x8Ey+qjcFqAyE6TfsbzCQ3/kH6S0OcEUqoTmKmgGzEVRHiB nPGEzkbtSJaf91iVnSoBx100zsGI2YKjU+L2yTnFMRWaYIKHpNqr3HCt6lkuZ6nBr6z4 iqTJfyE3ddDq2TCO80AfFlnXZzR6soVp/q2vQBWxvGwy7v+h3VSc2Vh52k2Y4MYujySS vbUQ== X-Forwarded-Encrypted: i=1; AJvYcCXemDf79E9JZAGEY6mR6WBNwWkN+PV4fxOxcB0gM8KejAqlJ0+upCBJRZG0eEGANkhsAhY6JF2K05o=@vger.kernel.org, AJvYcCXqwQoJpV3dvFikbVcbyd3SOXxOaAiESfzsrQ5l32Ai+cnCHGvk1Q5mgyipZxtsodQR9c8PX7QqfhE4jCW2@vger.kernel.org X-Gm-Message-State: AOJu0YwwSha+7tC8HYLDaj5qbNqMZmnIgoJpWNHy6ssaX21KbjmlhaTh ONXQEUcZVo3NCtwxlSo1V4z0+wPNbpLZ7RZwC/NjoZlfLF7OwrBy X-Gm-Gg: ASbGnct1vdsv7u3f7uVQNNg/lrIQsJvjEEZ855uPh3EIlZysU7KD1usX3lttYbqXWO0 DUB3cCZ31V9pNy+fDgvZOiqh3l3P5WVk2cg1qymVuhPD+/+P1YsDdDikORw03phLPC/APWlKwgX lRI+0XcHJnhff23AyxRXpgcCtlFcOEC3PAm5lLKpfRb8smhOSi5i3bUSfl/CBagNvYNgxjoKqtX 0ztnE4Nxg2z5KfTxpdhYuoTJX2EHs8TvfgBiDt9R0IymqbL9/dU7FNOtnhUtUcxkAbARW/JDSd/ dzsTYvDN6NgaMwhlHqK6cefKOHVfiefzefMzHn4wQEKeM3q5M4oQu5hUmAEC2WjjBNcBgrHbdkP +nnqCow== X-Google-Smtp-Source: AGHT+IEClAWnk4HlCe5BsrZlJ1ndipvs0umm1ENZRk5e7iXAcUlLyX0HZTrIkd52R3H0ji/u6pIScQ== X-Received: by 2002:ac8:5990:0:b0:471:9bbd:83e7 with SMTP id d75a77b69052e-471dbe9e46emr180601471cf.44.1739857556115; Mon, 17 Feb 2025 21:45:56 -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-471f194f857sm18398031cf.5.2025.02.17.21.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:45:55 -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 41E4D1200043; Tue, 18 Feb 2025 00:45:55 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Tue, 18 Feb 2025 00:45:55 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduhedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:45:54 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rcu 1/7] doc: Add broken-timing possibility to stallwarn.rst Date: Mon, 17 Feb 2025 21:45:41 -0800 Message-Id: <20250218054547.7364-2-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" Currently, stallwarn.rst does not mention the fact that timer bugs can result in false-positive RCU CPU stall warnings. This commit therefore adds this to the list. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- Documentation/RCU/stallwarn.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/RCU/stallwarn.rst b/Documentation/RCU/stallwarn.rst index 30080ff6f406..d1ccd6039a8c 100644 --- a/Documentation/RCU/stallwarn.rst +++ b/Documentation/RCU/stallwarn.rst @@ -96,6 +96,13 @@ warnings: the ``rcu_.*timer wakeup didn't happen for`` console-log message, which will include additional debugging information. +- A timer issue causes time to appear to jump forward, so that RCU + believes that the RCU CPU stall-warning timeout has been exceeded + when in fact much less time has passed. This could be due to + timer hardware bugs, timer driver bugs, or even corruption of + the "jiffies" global variable. These sorts of timer hardware + and driver bugs are not uncommon when testing new hardware. + - A low-level kernel issue that either fails to invoke one of the variants of rcu_eqs_enter(true), rcu_eqs_exit(true), ct_idle_enter(), ct_idle_exit(), ct_irq_enter(), or ct_irq_exit() on the one From patchwork Tue Feb 18 05:45:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979051 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 92DE31BCA05; Tue, 18 Feb 2025 05:45:58 +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=1739857560; cv=none; b=eD7o54Qrd7rf7DBOgOh3h0AU3kacOSXrsukkP0oaUmBWo3LoCHD9y6/x4Pgj9Pa6wIT21bRLVFKSpHzROG6w3gjd9qB5gDE59ctz0FOVlpEjvjmDyAgSiaZdn99tftbRCTkmdRKvwAWkkthUi22531POVn2//7XhpQa/GSn8IWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857560; c=relaxed/simple; bh=znV6q1mDaneWscKdbKWsvN/ldpVZ+IT+N039qxOFjVw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YX+uTe8h9kVODJa5ZY0BlxLHDq7JG6NPX2P265TP1KS50fy3is40dIz7NpT7ExlqYqPSb7tiHiDKIxu42nmV1ykasaptHISGlx220o4MO19aUvGFwkuLmNlG4JdlqOPImcZv39iSE49RBamsXNnmKB+6geeVSeWOyeegK1lUpzY= 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=JXrhr5oy; 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="JXrhr5oy" Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6e17d3e92d9so44320776d6.1; Mon, 17 Feb 2025 21:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857557; x=1740462357; 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=6Vf753JDhe8z6or4Q4Z8/1KFw/b1u1ALZFWVEgBrHYI=; b=JXrhr5oyKU0Mhd0TK+DTvOD4fh6ZtxBtty965znP2YR89xfNnUB8Cd/A4iEp1dIRjA /qD2PXy23jJcdTfjvGgIUwge3+EPaSDANvBCJYPpnxmJWExSPxKHyD3Jgqkdb6ZBJFbp 6XQqcv/b+LnmSjnMa6zRWljee8HOJAw0hl0fVl2pvn1RMUUM1KX7MCE17MLtluYjVJsI POZJMB3DqLG/X+15mvUqqF6uHXRvf0iehLC4S07eoKMcjZo3Genp24Ot/V5zyvggIpgY fsrf4EwAoDPd64J9vTWYN63VuTbtI9iL7JW5+omGNhRSf6XpE6LlUyrn/3uRxLwhzYkz yeAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857557; x=1740462357; 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=6Vf753JDhe8z6or4Q4Z8/1KFw/b1u1ALZFWVEgBrHYI=; b=WSx+vg6P9ZEusC9OPjf/nvutsgPIbcIDVY9BouVrskti4dzAbNYIeENqcLvobmgptB ZHuhJJTcEsFA+vlZdPSZosrMFTeXUXmWTVD/timeWEAZ4Ix/rqx38NwHoP9QGgFG/J2B vwNvcz9HTQzF2ppR/V/9rjJVKLKHRYRv34noRq5RiNUb8unVrE6DANLsCpp5J1kJQZvT K6GRRoi7RpTB1kIqnWAMrIGNukInzFqTlhXc7JS1CB/P5UgZqiqnkib4d8knIPnZfGgE fgHWka4A4C4aMLeqAuKAO6KV/QiAT6CMO+CzJKlakbUJzG7vKMK5AUgh/FScgGJLt5vl mpbA== X-Forwarded-Encrypted: i=1; AJvYcCUx0tzTQhWETw5fXu9CLJX8uXGWBNKk30nmKdQ7rykr/Ix0V2+gwbt6DY3ud1sb/SDe1F9KT45AN4ui3TJY@vger.kernel.org, AJvYcCVWr9Xzo9kSt5lXBwCVUOj0s6JCnXbS1hEgdu4BuKFd78dWPq19DUC36x/sLRInIKhLTXmaAB08Zww=@vger.kernel.org X-Gm-Message-State: AOJu0YxsVgFd9oULb0ssWVoKzqBd9zF5VxYfKOw7h/LaTKjx2hhT8lLx lN/hnT7HP402ofhXDQ9uRYnIsvyp3oxXVdM5JYlncTlati1NKRUz X-Gm-Gg: ASbGncs8kffiYfbx6tOGCEIaY9DTAJP6yxqJSlw3GjcIeL3dkAscCHBam7jYg0lroqw uSaEQBZxz+qT27mDFq5oM3ihnbuwEIVVX4MRBwXfhYFDZpdqW+f96U1lkOlhiicPkIho6FFrpRM A42XLWs6C96t0yRzRMAWiG4MC+Yv/6s2648ZTp+odMZOxZ1Ulimq9nP1fapslcmM5nkN1OtsopJ kSEgg58/pU/3wQxnVlBvBfOaONbAm7BrGOrBqVvjWZctObBEAOX1+NgbFcnp2FmOs5+OxU+UXIu cxM7TfoWjsSH9hZhkImlvhYiSJK/b424qHpnrBTrfpiFFZmAriN9vJWWB7lIs3TqR4UdCQiBJC0 BevIHUg== X-Google-Smtp-Source: AGHT+IGIisUG3omfsORc+ODA3bDfKzM5YZqfS2TJ+KRKxOHtisbBRQGfzfSfCbUyiKU+SfpmUtXRiA== X-Received: by 2002:a05:6214:f2d:b0:6e6:668a:a27d with SMTP id 6a1803df08f44-6e66ccc41acmr207712506d6.16.1739857557541; Mon, 17 Feb 2025 21:45:57 -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-7c07c86e878sm621169385a.94.2025.02.17.21.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:45:57 -0800 (PST) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfauth.phl.internal (Postfix) with ESMTP id AE8951200043; Tue, 18 Feb 2025 00:45:56 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Tue, 18 Feb 2025 00:45:56 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopedujedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:45:56 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Mark Rutland Subject: [PATCH rcu 2/7] docs: Improve discussion of this_cpu_ptr(), add raw_cpu_ptr() Date: Mon, 17 Feb 2025 21:45:42 -0800 Message-Id: <20250218054547.7364-3-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" Most of the this_cpu_*() operations may be used in preemptible code, but not this_cpu_ptr(), and for good reasons. Therefore, better explain the reasons and call out raw_cpu_ptr() as an alternative in certain very special cases. Signed-off-by: Paul E. McKenney Cc: Jonathan Corbet Cc: Peter Zijlstra Cc: Mark Rutland Cc: Boqun Feng Cc: Signed-off-by: Boqun Feng --- Documentation/core-api/this_cpu_ops.rst | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Documentation/core-api/this_cpu_ops.rst b/Documentation/core-api/this_cpu_ops.rst index 91acbcf30e9b..533ac5dd5750 100644 --- a/Documentation/core-api/this_cpu_ops.rst +++ b/Documentation/core-api/this_cpu_ops.rst @@ -138,12 +138,22 @@ get_cpu/put_cpu sequence requires. No processor number is available. Instead, the offset of the local per cpu area is simply added to the per cpu offset. -Note that this operation is usually used in a code segment when -preemption has been disabled. The pointer is then used to -access local per cpu data in a critical section. When preemption -is re-enabled this pointer is usually no longer useful since it may -no longer point to per cpu data of the current processor. - +Note that this operation can only be used in code segments where +smp_processor_id() may be used, for example, where preemption has been +disabled. The pointer is then used to access local per cpu data in a +critical section. When preemption is re-enabled this pointer is usually +no longer useful since it may no longer point to per cpu data of the +current processor. + +The special cases where it makes sense to obtain a per-CPU pointer in +preemptible code are addressed by raw_cpu_ptr(), but such use cases need +to handle cases where two different CPUs are accessing the same per cpu +variable, which might well be that of a third CPU. These use cases are +typically performance optimizations. For example, SRCU implements a pair +of counters as a pair of per-CPU variables, and rcu_read_lock_nmisafe() +uses raw_cpu_ptr() to get a pointer to some CPU's counter, and uses +atomic_inc_long() to handle migration between the raw_cpu_ptr() and +the atomic_inc_long(). Per cpu variables and offsets ----------------------------- From patchwork Tue Feb 18 05:45:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979052 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 34E8D1C07DA; Tue, 18 Feb 2025 05:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857561; cv=none; b=PdklZIDj9EQ7LxgdOPkLYEMruZKlPjpwI00F2Dvb8wwG6WLB38Qn0vmMMs0F+C1Fs4elZl/O0oSwPsYvz+GEFGecx7aPvkNM6roCHVQIQCzXrrmIt0T8Jn7kzt2alh6fq/B6DY7Ih9f1DoFlivS1jbKzOldu6E+1FGl3vNC9oFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857561; c=relaxed/simple; bh=Hhk6qN5cX2HiG95oLWWknwJOUcfQbEf5crAZtdyGlfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CfdZu6xmOD7IwkC7b4+1ynk46NBlU5oniVAnTIFuWOnEMUXAqWBEZlBPDN4IGRnXkbLac/8CEmairQFrtlisQ4FWdvAY0iAaEXeyHdLY2iv7degTWvLb2PwQAOZNYmo/WSm+s/IbL5njHmpfVkdZ9ue2zdwF1xeZz7lOCiq3VyY= 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=X9C531At; arc=none smtp.client-ip=209.85.222.177 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="X9C531At" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7c0b0ca6742so7544785a.0; Mon, 17 Feb 2025 21:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857559; x=1740462359; 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=AFj8E0Qi9rwHd4n/4onPY5cFP0jmlV+xnlSEn6nuc3c=; b=X9C531Aty4409JbrbfOE24ou4LRrtOUW64nnErzL1h2IuBtAzKiJdOGhjMTvkG65zE J0GjHP737fCNNxIeOVT0KB8pFGJswnu8/jj2T0S05ce3H96qvP/EdxE8DUQRRJc5tmhT d7Qu+SMCYoJAkC0AS0evwKOjXysfTzqPSOvqlENDtIZXGqYuxJ57u5hzpm6UR2BMN3I2 yTytkVqtt0pNKLAbgUGrSR7Am2ewMrmLiNEFTlm7wKeLwve+lw21sETX3sf8CLz49PCH RP1BqnFMVeK6i7EwYihfJL8R5D5OXJSNevvr1niO9LymowVWq6moF+ILm1qPfmq5+s8z g04g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857559; x=1740462359; 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=AFj8E0Qi9rwHd4n/4onPY5cFP0jmlV+xnlSEn6nuc3c=; b=q3Ds5cbRC0igVo+oQq+giL8QHNkNkEJxmqkuZHo/X7Io4jSonmJQQRQWaCiktQ5Yj8 ljZ5XCTSomyVlkwYXOu+Jd4yczlb1RAqAgdQ+mxNn4trnP4McI8jckKeC8jEAwX/HRBF doFSF9YFsWGQt4dgixJ4KKPOZlDDOtbQsTld/vPtyJK8rJSmNH31ZwD4dr84Oe36O0PF J7SWl9whG9n/NNeU4IYulCZ9mk4fGcCed8Q0WEDbFhk7Ms1rBXKG00d0d2okIsOWc79C l75n2/YcpSQOEJCodbuqctsSSDFF8QtRuwgkCAJfJCyv+LuZDoX1YE5Q9g+ztE+1+kbk +siQ== X-Forwarded-Encrypted: i=1; AJvYcCU0WAnlupaKWVJ+i8lXose+szClGCYv1H3/qhC0X16zifx9vAS8gUTRV9BI7KToYs1zZ5ChzsoLIx0PtN/C@vger.kernel.org, AJvYcCVvip2vwfoWpRg6N/1bQcGjVxcim9QWxRYKhwEnfn2sukAomoVf6LZdzSlbdELptcBKlu5476cRLyc=@vger.kernel.org X-Gm-Message-State: AOJu0YwUFoahIK65uAkQwYJInPBz3VRYWNBsotXUpTtGUHuSkP8mbNn1 /kuATwt4f21+cc9kHQ8vj4pVASIibBZgQDMVPqcXmG2GmYvFhbcg X-Gm-Gg: ASbGncsjuf9uf3li7e+EoGtiazeixlZGqdPsUbNfA7w7Fg0bMWrq5mbn8mmLCF048Vp eUhtOz0MOUm0iSyfIRupGJ1NvwJzS0QKXmrShQQMeEw+6SbPhQXcp6A+HqYZw0TO4R+WwK8oT9N 55QoyRcUrVaJ66+7nQF8lAPm5vP0h2IvDs83bp9IV7/5sjrQ7bJ5UYwTjPBSRGTozz32Gp5yw/M iiCVobN+XEVkmHeJ/OjzJd9bllAyXKeLiUMZLJAB/IWcP3SP04ZIflOr9rPC1efIb7A0n5b3Mg5 Buq0B8w2BKG8wHbEz+dlBFfbhHOcFZm6uIwPgK77urnK9TMqyZZIpFoWRKhxWrlphhSejH4s3CZ fH6pJ9A== X-Google-Smtp-Source: AGHT+IHWxpzdBnwxq8h0kCtn53UgHTkb1eFWOIWxmYVOxrW4NcSKcMcZOEzhnOTf1P+9dm5uB1CHSA== X-Received: by 2002:a05:620a:2953:b0:7c0:9df3:a0cb with SMTP id af79cd13be357-7c09df3aa26mr971954785a.53.1739857559006; Mon, 17 Feb 2025 21:45:59 -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-7c07c886939sm620307885a.114.2025.02.17.21.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:45:58 -0800 (PST) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfauth.phl.internal (Postfix) with ESMTP id 2FF6E1200043; Tue, 18 Feb 2025 00:45:58 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 18 Feb 2025 00:45:58 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduiedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:45:57 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe Subject: [PATCH rcu 3/7] rcu: Document self-propagating callbacks Date: Mon, 17 Feb 2025 21:45:43 -0800 Message-Id: <20250218054547.7364-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit documents the fact that a given RCU callback function can repost itself. Reported-by: Jens Axboe Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/tree.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 475f31deed14..2cd193ed854c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3107,7 +3107,7 @@ module_param(enable_rcu_lazy, bool, 0444); * critical sections have completed. * * Use this API instead of call_rcu() if you don't want the callback to be - * invoked after very long periods of time, which can happen on systems without + * delayed for very long periods of time, which can happen on systems without * memory pressure and on systems which are lightly loaded or mostly idle. * This function will cause callbacks to be invoked sooner than later at the * expense of extra power. Other than that, this function is identical to, and @@ -3138,6 +3138,12 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry); * might well execute concurrently with RCU read-side critical sections * that started after call_rcu() was invoked. * + * It is perfectly legal to repost an RCU callback, potentially with + * a different callback function, from within its callback function. + * The specified function will be invoked after another full grace period + * has elapsed. This use case is similar in form to the common practice + * of reposting a timer from within its own handler. + * * RCU read-side critical sections are delimited by rcu_read_lock() * and rcu_read_unlock(), and may be nested. In addition, but only in * v5.0 and later, regions of code across which interrupts, preemption, From patchwork Tue Feb 18 05:45:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979053 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 C802A1C6FF8; Tue, 18 Feb 2025 05:46:01 +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=1739857563; cv=none; b=NwdWO331r0SbICQEmuO59e33fCiKK8JwFpGc89yWv8JgqmKkjnWHxyH+HW9coioDoi3dSMB5OF5siiGnUR+mtWYPN6+ofSEFsZDcJTSMPNcFFBgGTBEuWMGnlvKtFmxTCUsKqMbi4Mtol9YY4aTTmiL0GXuUwQGL22rknvsPwTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857563; c=relaxed/simple; bh=3vFd1mN8dxuIO0lNwxRqYwG2R9ldYvt17FcLNexC85w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u1SKtIW656mY7iUU63FiQ4+hj3cGVWlbzRlX8sy0rYGqHTlUZMylOCm7uxBPwxrAWXYfMfAmWT4TmWY/AQJ82Boci3JFNC1C6w5EnB6jRTsYDVXh5vm7lzlyer21WqBAUKCAawOKQQoVF/Mpu6f0/dmNQQUbwBk+FiUSFeTvTxw= 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=Vib4qMPA; 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="Vib4qMPA" Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6df83fd01cbso24898656d6.2; Mon, 17 Feb 2025 21:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857561; x=1740462361; 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=d+SA0W0F3ElkDDFf84vDj9xLEft1xrgSsYntfglUP4A=; b=Vib4qMPAulC3mFqZNW1rGW0vI8GYa85IiPPIU9nmq8JVldo+/6EAxcv8OAXszoQacB Fe29M86poQIddu6/9+Av1+ctUyOcrmE7y1llt8QdOui0K6/P7r04YQT48IqgfnhIH3Kf 7+nBPBG8vxah/2VyREgQqHMlAgGU9Fwx1U/4RqYOnWxlkPJACY3NFJkw3htXLEZr1edO cwEjfsgGQm8n6dpk4jNXvO2whio6aix72mLg+/4k5Ya0pNo8UtnkAdEiNFyCgoAjdGFx ZL1+kUcL1ajuKfbE4cYTtzVBFW2pb0XiKQiBtWvzTg9jVmlXzTkgh9WZul6rA9OUK4M5 d/1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857561; x=1740462361; 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=d+SA0W0F3ElkDDFf84vDj9xLEft1xrgSsYntfglUP4A=; b=tWNyUQAqPy0dOG5u6WszfreyotMdN7VhRaBTuEm0EIWNuTxX6k3Mw5qwEFtYxs7lh2 kH0grrECy7yG2bwU9CCZpowN2wkRaxZbVSXIlx0h7bu3h7w2/DfAU7VreFqrY3LaVsTP XQEZsRGlebOsf01H7KSJYPoAmjkjkb/+arJe6MrbYk5ZoQnYCm78mPXMv7sEzPS6O+EP HcTPDYhlw92xlSUSGqKdkW6sG9BiumQwZctrEG4lVgUGAAOzv8Ubc9e0KfC18/zz58H8 bWQXx6zv02dG57vHWEPh1ok8zetpjlxHQz+lY1viPubLTPRi41U8FOo2fnuQLpa9RSpz lwZw== X-Forwarded-Encrypted: i=1; AJvYcCWP9sN7klLWey1MwdG06AcxtnqkAnmplaam34G46hwOV6049M1T6I9QFpo7enrJt0zEkYfmbpfjny6nqUUQ@vger.kernel.org, AJvYcCXM0xJ9cW+GsAlsHtwiMmF3YbjU0TZ5s6wrra3W6xYgqe7wuOd/oFskzIiYRnKTzbSgBvkFYtiN5js=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+RwKrkzjJtZm9yIk7V61jQfr1VsxIZoNFYMFn6y4ireamY8mm dSbvLZ3Xi2NKHUVsZuDLwk2ORWPVmy6UM7T5bODHFX7N3dVE+C7LWWKuHQ== X-Gm-Gg: ASbGncugPHqXNHZsswJBc+VWtckFhgpSFejkeHcDnRBQZPL/lnQjd6qGY+ATIF1qBEo 1//lRrFqdGVTUyzxUgUVVoFySAwSnf+5fVCxsXQUS7Y/+iQtJQT1WQpYR5Fg7x0cIFuIMrHK3SG er1nhKExnn4TRP1j2RSoxtilIEQokAIIqN6LEMj4m7gXslHR0FhCbZcsmQ8wLAd7Fo2yHmz3qIw netjDXqFkYt0m42cs2HZZuq4q6ZExK6N5YS1T6jdd8D+kZC1bTV4xz+WyQDzVc9fmnXXGmjnIB0 uaUit3n9K9YZq5hJZg+mROTRxJ2S6HqCbrMYfkwkY0zOCpvU5lugI76u3icW1ksh9XxMR1UBLCp CTOvV1Q== X-Google-Smtp-Source: AGHT+IH1Npth3Qcqe1DSEFjRrh0txsuwa7zTkMhckGnpeSZQim+JRJAhujp5DQfMimEWJfyHjuE2UQ== X-Received: by 2002:a05:6214:300e:b0:6e4:2d22:a566 with SMTP id 6a1803df08f44-6e66cccf032mr159363476d6.12.1739857560678; Mon, 17 Feb 2025 21:46:00 -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-471fcbef8d6sm8480841cf.56.2025.02.17.21.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:46:00 -0800 (PST) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id A79541200043; Tue, 18 Feb 2025 00:45:59 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 18 Feb 2025 00:45:59 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduhedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:45:59 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rcu 4/7] srcu: Point call_srcu() to call_rcu() for detailed memory ordering Date: Mon, 17 Feb 2025 21:45:44 -0800 Message-Id: <20250218054547.7364-5-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit causes the call_srcu() kernel-doc header to reference that of call_rcu() for detailed memory-ordering guarantees. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/srcutree.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index b83c74c4dcc0..f87a9fb6d6bb 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -1398,8 +1398,12 @@ static void __call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp, * read-side critical sections are delimited by srcu_read_lock() and * srcu_read_unlock(), and may be nested. * - * The callback will be invoked from process context, but must nevertheless - * be fast and must not block. + * The callback will be invoked from process context, but with bh + * disabled. The callback function must therefore be fast and must + * not block. + * + * See the description of call_rcu() for more detailed information on + * memory ordering guarantees. */ void call_srcu(struct srcu_struct *ssp, struct rcu_head *rhp, rcu_callback_t func) From patchwork Tue Feb 18 05:45:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979054 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 096A51BDA91; Tue, 18 Feb 2025 05:46:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857564; cv=none; b=BV7WuC/h5qecR2gutjNrBWC+Mjilv7ij4v7EOucbpeekmVI/GQ5Ru5Mh4N9edruhYwImK41nRF1f8blKV2gZYoDE7FJeRInUnjKhjva7GUYClNu1rSnQ4zrLWTlinYen1KjP1cUjqhblKwSoKzknvKdyPMNUs0+hSbB4mZvv1ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857564; c=relaxed/simple; bh=SVKo/5gLmbKnQEp50nZawVJcERWFrqzurgjroht0oMc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FVEUlxCcpbmbBPXEOlZzA6ktdBtFRIq7ojpv494NogWmRKECjc0bMYhiD/j1Iu0+QnW4iqkEHmviAL931p6T/YKtviS54bmXlNH4GgGqQ93hBWs16icydWd00C3i7bO/0HzOFIlkfodwdkNOhTuMChGQu7uEIoShf1emhsrWuUE= 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=HNaCDHEX; arc=none smtp.client-ip=209.85.222.177 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="HNaCDHEX" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7c0970e2e79so315252585a.3; Mon, 17 Feb 2025 21:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857562; x=1740462362; 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=5Ek/R8Hi0E15SqkOu9AVo8oTZDPYXJVZ85ePqaSyeVw=; b=HNaCDHEXkXOSuD+zqugJWx6d21OMnnztD284nQiXc+pb6Uj6a57iB08yBc7Ht2zCkA Fc55zohduObaY0LNAfIjLniHYd9V33vAm29J9odmWUFaDc1M6ahQo6qBJbF/ZBz3sc4G YapZkT8XixqdSvsW/Dx5+NOxR/f4kYWoIrpYhQHnfd9CsiTvlJ3FpCUWkTXYXScM1R0h Lo4veY9QbOX0g8zB7wQJP4Y9yh+P+GLYRfSiet2DtHlVJ1FIhb7lVxpnEtTXeLKMZ5Gr 4WrtPFYvFIA+6yGTkYaW8fDO1sIPviWSy0Q3Rn2FL9Po8hCrTurpQy764MZF6IOKXMMm vWPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857562; x=1740462362; 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=5Ek/R8Hi0E15SqkOu9AVo8oTZDPYXJVZ85ePqaSyeVw=; b=drrDFprLYPKt7fIcXtBE/IvJFhx2W6FSbpeH5TwX+/XVcHxK+Xo1ikPLV2I4m3s67x SyyT1hF0ZUXF5AfiF0aIhmpsHPUZztRzX7aRVpcURf8gLoKIiXVpE+ZMq0+wSBOWW9qx K4nZoeYZ5P/d/Lz72DalKqQ6xctgonqiLONBGMch7FC2iWu3PdTyWpHOGnCkmNp0/MYV QBbIDzTemyj4k9NhBGV/TMLSvT99y8Q/WoEGhueD2+1V5rtpPVuxORpigz/D7MzcNZ9p 5/DhjhgbndcVAA5sib94mqSFc9k5F39yl/XnGilk/yQVOtFZUOgVBRfOxbhGw7xyWiFH 1wjA== X-Forwarded-Encrypted: i=1; AJvYcCU0hjGXPAWrhdEtpAlUfHntClip152CgFoZMmxiPkcNlKVY5ZiaJxjTOe5wBbQO1kX6Z2wLJP8LFqzc2xPk@vger.kernel.org, AJvYcCUicnKmeonR29fituoXcqt+ibtVG9Gs6A1EUrZzijNvezKJzZp8QkS8amzArfRIWQMHo3gpQm2jiuQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzAdCrfHaN0PX1W7bE7eCO+6t7RsKng8kMtYoZtAnvBtWPVBbsc ulz8AekaCpai8bJyWXNKGYTHxF4bLPk6bg0GHQek1eqozJyqnZo8 X-Gm-Gg: ASbGncsNd9HChD556IYDTp6KZ+gy0AJANdEaZrOSXMifL1x09YvGbZM1r0ktXOnaBhF xrmqIkGwsnziv6rC5Jm0l9dBv/RENAIb0U2dxX3Vbr0mZjpOHK5ymaeKOokw+GK5rvhjYHFp3k6 VId+HdmIGyEHcvImLHNv1l/ehXsB9XuMKrHaxGXwr0XZs5eYU+AXKbV4q/cBLB4tPq6Bfh3Ox2i RC2l4cg3l0JiWtJDcJjBcrK1dPS82eL5qSLjHxL2jE8wbMWDHsQqnYUuJgp9cRdVXVNXNFXmu+i txhN4LOJSyLvQvAp2vdEGQ3cCK/DPoNyFdEAZ9MBsLOMusrcGMkK1FdRJfmpj5EWBcT7VXOVACJ EX5Inlg== X-Google-Smtp-Source: AGHT+IE+jZADXT1WftgC47lrepiElxgQ0jGHyauZ55yN3mAwZXV4I60zoEAVM2f6IITuz/AD0ZdAcw== X-Received: by 2002:a05:620a:290a:b0:7c0:69a0:d9ee with SMTP id af79cd13be357-7c08a9f54b2mr1672320685a.33.1739857562058; Mon, 17 Feb 2025 21:46:02 -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-7c0ac2bc478sm63711185a.21.2025.02.17.21.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:46:01 -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 2EB9C1200043; Tue, 18 Feb 2025 00:46:01 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 18 Feb 2025 00:46:01 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduhedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:46:00 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rcu 5/7] rcu: Add CONFIG_RCU_LAZY delays to call_rcu() kernel-doc header Date: Mon, 17 Feb 2025 21:45:45 -0800 Message-Id: <20250218054547.7364-6-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit adds a description of the energy-efficiency delays that call_rcu() can impose, along with a pointer to call_rcu_hurry() for latency-sensitive kernel code. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/tree.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 2cd193ed854c..780e4b30febb 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3172,6 +3172,13 @@ EXPORT_SYMBOL_GPL(call_rcu_hurry); * * Implementation of these memory-ordering guarantees is described here: * Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst. + * + * Specific to call_rcu() (as opposed to the other call_rcu*() functions), + * in kernels built with CONFIG_RCU_LAZY=y, call_rcu() might delay for many + * seconds before starting the grace period needed by the corresponding + * callback. This delay can significantly improve energy-efficiency + * on low-utilization battery-powered devices. To avoid this delay, + * in latency-sensitive kernel code, use call_rcu_hurry(). */ void call_rcu(struct rcu_head *head, rcu_callback_t func) { From patchwork Tue Feb 18 05:45:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979055 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 ADF571CEAC3; Tue, 18 Feb 2025 05:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857566; cv=none; b=X67Kza2YQHu//paPyHDja+uMZQ8z0ZLf8Fo9b8JiI7M0OWW56HodoXBX6fqehYcExVitDQ52XEnyyoSfcV1ScWxNPQLU8YWPv/leBpFDXPXS2OZqRvmlD/SI6wYi3wQr6YbkuzCU0L5wSz7BgXuVRk0+BAvyxpTEg4+SToLbCIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857566; c=relaxed/simple; bh=gGX4FsCiXZJ8ZZ7+WoZlxvaI6QHaQESgtAxBsTbrf4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CrxUoOcZTUe4igiyWUb8EWUpGjOp+gwEEI7gz7bOefeU8eeoiaEpg1rptvB2OK1bbkPJ54c6K/L2DjQcryxC5grrlO5RwqCK336B3TvIBoeqv+E4w1uwRwI5ryhhrcHlOb29qHcqcvEfEOhrgQa+/jQliZ1a/J/yr9fkmvK6c1U= 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=VoWPodqn; arc=none smtp.client-ip=209.85.219.47 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="VoWPodqn" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6e6621960eeso41295076d6.0; Mon, 17 Feb 2025 21:46:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857563; x=1740462363; 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=Ti+Pk+mBk7PK8fxnF7pRwhz3z0nqohliniWgvUQSKn0=; b=VoWPodqnd/TCCxyWymN40byYwKBOJRVJwQCMcH4m29WU3VpuBZgU0pfEkBslO4phaU ubkVJqPoU/d7hn/+xPqwEUrGZGQwh1GTEw+zoV1WKK4ZahfTB+p6N775wS01YtgoIghr xmItY71ecgtUMD6/pIK+55b7JRa5t5cB7GwJL6FMLWortC1bp4Jk3k9tWBBah4LwvqVx JVrIe4tuTf1Gr3kwdCsKObIX+d1Hn34aBK10WN5Upcev5Bzc8fOvhvpiiuHZy2pXNn+l lqcMSiKfyIIGpLi8TPcre5ybV6K6LlrEBFjep1GEH3Mb44hRFuG+NdBX44BU1Uk2bAeK TIsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857563; x=1740462363; 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=Ti+Pk+mBk7PK8fxnF7pRwhz3z0nqohliniWgvUQSKn0=; b=ANvQVPlyI8U6ZgI3YipzJM4p/yBANed6xOtTYRqr3DUxNJgXYjoq0si2RVjFort5Dh +iIu8IH9cDM8NdcWTVHA38aaLQ5qMQcwBzHFvSZswOZWuAkH0kxgORoJIYuwrfyCQ690 pCpY93L496AjLEYM/4LIOsTXPCAI5j3KzLIV/w8U6XV9PJ0FmRnFi1DSJBx2b+E7boCm qEvEWT3As0WOOq9mMFJ/8NdHOdqDAEmInI5ZfwncZGEnBFzmot+KiCy0TdKPfa2qOc/6 /s1F6Tuvnv2bWsjsZQJZOA4LwCJBRmU8KwBN5lNxYijjLvyoRWp0e/Z44NnEo3iJKQhH UG1Q== X-Forwarded-Encrypted: i=1; AJvYcCUI7MaGViRKD5+djFgf2gMlPnupRRiZv8phWA4awBOWHBxvYLT8ak3Q3SjcltZlts5OvpOJqvamvZA=@vger.kernel.org, AJvYcCVqlvDdvmbwShrV/WPnhZ972K+Pfrjvp91HrPqxhsVM4UznE06CVroldg5UrpOyf5DLbFatyaWiwgspQTCN@vger.kernel.org X-Gm-Message-State: AOJu0YwGm4a54OsCjtkZCTflEUujJrSaoAZ/nyHQwp/fdoCcAVgeJUXF DgguQDi7SIjkUkVjc9gE6KLjkqaDsXu5BrNYstYLfegxXqnIvFjI X-Gm-Gg: ASbGncscZ5M0zGJ/LFuxewcYdxC14ZYIZWLaB8h0l6Oh4aBT1M2DAFn5gCXS2vKH2Ni PoLcQHo3N1uDO/Z/EnHrEJd8kME5Yvv+KvQP8bulaeaUhGoE5lx8BBgz9vIBS5/my1e+6PgCTRN ih5HTu5T7iLZ3Ivo7cSdSu302S+xmZ8nAnxLP0WUeA2WFl5Zo+rkwT0reroXmtRwiSh5BxWjpvD IBW0+EJ+4CVK3LPTOMadjkEna3766Oz3gwGS+dmiF70aJBdRkxT1shAhu+wUgzpmctoLXtXMcI7 8yb4pUdGdAX8cleTu0uZJI+NdVUQvKiLdaO3jV1eV494SkcK841KWjWFOuC92Ad5S2uUry4mYWv IcvpvLg== X-Google-Smtp-Source: AGHT+IGXjA0SVcPAeRrYT9L9owbyGfR21mZr9aSl8Vj9CbXvXgYISkJyHB0OXrwPypzsCAZvWUQB/Q== X-Received: by 2002:ad4:5e8f:0:b0:6e4:5f2b:9f15 with SMTP id 6a1803df08f44-6e65c8fed77mr273991976d6.14.1739857563558; Mon, 17 Feb 2025 21:46:03 -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-7c0a1f089b2sm165544485a.53.2025.02.17.21.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:46:03 -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 9E12F1200043; Tue, 18 Feb 2025 00:46:02 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 18 Feb 2025 00:46:02 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduhedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:46:02 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH rcu 6/7] rcu: Clarify RCU_LAZY and RCU_LAZY_DEFAULT_OFF help text Date: Mon, 17 Feb 2025 21:45:46 -0800 Message-Id: <20250218054547.7364-7-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" This commit wordsmiths the RCU_LAZY and RCU_LAZY_DEFAULT_OFF Kconfig options' help text. Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- kernel/rcu/Kconfig | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index b9b6bc55185d..2bb22dac3b5a 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -323,21 +323,27 @@ config RCU_LAZY depends on RCU_NOCB_CPU default n help - To save power, batch RCU callbacks and flush after delay, memory - pressure, or callback list growing too big. + To save power, batch RCU callbacks and delay starting the + corresponding grace period for multiple seconds. The grace + period will be started after this delay, in case of memory + pressure, or if the corresponding CPU's callback list grows + too large. - Requires rcu_nocbs=all to be set. + These delays happen only on rcu_nocbs CPUs, that is, CPUs + whose callbacks have been offloaded. - Use rcutree.enable_rcu_lazy=0 to turn it off at boot time. + Use the rcutree.enable_rcu_lazy=0 kernel-boot parameter to + globally disable these delays. config RCU_LAZY_DEFAULT_OFF bool "Turn RCU lazy invocation off by default" depends on RCU_LAZY default n help - Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default - off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch - it back on. + Build the kernel with CONFIG_RCU_LAZY=y, but cause the kernel + to boot with these energy-efficiency delays disabled. Use the + rcutree.enable_rcu_lazy=0 kernel-boot parameter to override + the this option at boot time, thus re-enabling these delays. config RCU_DOUBLE_CHECK_CB_TIME bool "RCU callback-batch backup time check" From patchwork Tue Feb 18 05:45:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 13979056 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 1CF6A1D5AD3; Tue, 18 Feb 2025 05:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857567; cv=none; b=tomc0Tgby0AECMPqXarPNSZP5DB4UIu48Qu1CPKxO4Vc8q/XvcvciqgbJQvrMJBigpyOrCCM6I/U8jFxeLoz7uLi58H04c1yrni2bJuXH6r1qJdHUaxiMv/RKSySObK8YBxLdA5e4ftzjuBIAGx0fL5zWzIDgbxAYbzNNL+5u4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739857567; c=relaxed/simple; bh=OfWXye8Of8O9FMlyzbA9MTX1oxKIhmqiEz/OMs6hb7I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LXoxJwBMGfW6Z/Z6Grb3dtQaxp88TE0cteyoFiOeRAQ7W/V9xFQKAxoxis4ZceVqJX6VwIcvBmtUQG/IXOjNX59NRl6JcQTHJ9IRNFs2Tw0/D+zj6ETeiu8Mgxlb3yTCFTRIfx5sQeVD91a1Mu1oDJYrb+CyCub8j9aeZJNE21Q= 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=W0IXA1wk; arc=none smtp.client-ip=209.85.219.46 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="W0IXA1wk" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6e660740061so47300456d6.3; Mon, 17 Feb 2025 21:46:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739857565; x=1740462365; 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=KGqcu9I3LwOV/o63af69yARDQi685oRGnRYvxczUj+8=; b=W0IXA1wkxoT6Wflqq3i8fVZmA2ULXfl1K9zUGbilO+n5zaEOk0rMEFda29tTPESNYC h+pOcmKAXIfp/rjjQdIyDH1SLKhKFPqd2tF5c18/1GuvwjTCMWXrUjGzNTebm89CFUKx qyHB1ujhbwBhQ0hPv5/WWZmjcRM8/dPYbyuZkIIaeOb4m0grIlg7mLfod73132V6Pku1 TzoFGFg04LmbCrNH9ni2dPPI5EXKkVpdQfxkflpBQ7OONCZw0vba8VVeF6HQtZ19HEH1 7mF70k7pOj9CQnomlgMfVqh6EQG29qLBv/rrIcPhrqVtp2RBnd5+WEtOUAqTEDnzzy5q GqKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739857565; x=1740462365; 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=KGqcu9I3LwOV/o63af69yARDQi685oRGnRYvxczUj+8=; b=Ob6hGWPrQAWqz/AQFjLNVGFkH2o4d29wEd5msr5IgqnyfHzetHZ3wTYBShC4NnmxaT wOOSxIp9QFTCV+BaJHIYE1lWqcwqExHgOukJPGNl/xDUfAw365WlAq3bH7wi8ZTXgT0/ V79hWUYJ+1/jGikWWJ7oqUMBLaWfSCHhgA65/rKweAQ1fYylEczSsMud4TiMIzd1+YxD h+/4OzjWX/fcKie4x6F8WiVfrepxQ8TCnsZMvQ/GzHCoWm8aI4x+Y7ySUAkPK06TF3X0 jLCXkD/vOIQcGEcRIQ3vF4+HV1hyGc6bdvRpfwxSwhVQ7Arpn6yZlC8kAdtgygWLOpzX bLWw== X-Forwarded-Encrypted: i=1; AJvYcCU6SMuKMN3rf84lBNEm9PCxIC2fPO5ysblNiYAAuuXWlRYZX9OAIDCfzMVT3N5XdECaMTRe7mmurwofmfWj@vger.kernel.org, AJvYcCUHgFcdG1gWpfYECypp8jYduhgt3rsq1W7uo+xqWNTDG55jplDTVW/SiQkRQ5iGGQCvfKtL6P+mYkY=@vger.kernel.org X-Gm-Message-State: AOJu0YzfzmOg4wMg+65iPJNT46X3tBA6FbFgLg9rOZaxOJlA8MDR0+Mx 5le0UK2kds+DTfBNh7iqBGwMxwsk9qp7tIlMlVaLeCQrdxFqioXK X-Gm-Gg: ASbGncum4NQ29ABAKfVKAl4Cujl+JVBijOhB8XxERoODrxPfoUcklAFfMrjPwWItcnf 86ZM42L/IDHN+D9scowFwb9BfGffHB7VFa/V/Du1vjvBgFFfqur7eU7eySLuittB/EwM+GKfWcm JbKmxRJxcldcbMru60P5k86o+dFMMTAKk3nFM2hUPh0NVccGDaZV1MtgZOOPtcrGQDosvNgY1Ph 2aNWtLA3VRYIdS9gr6JpgFa4igKscNm80819YUiFr6MD9OHlNnaSqjnPX7JG4ftVjVYznCTyIAW 1yPG6QOEHtKkI1q5gA6f7HTmgocGKEKgc8AV1BflIVSEVUVzo928RL/XXAL9yQ+SZ4BvYQ1PE0N 8lOh+4Q== X-Google-Smtp-Source: AGHT+IEAkSg/F5FygsWRs9N3+5vWlJflzbDzp53QeMTt6VL9QsT/DkGXNgp+CdGkt1Y7eFgLZjdrfg== X-Received: by 2002:ad4:5ae6:0:b0:6e6:659d:296 with SMTP id 6a1803df08f44-6e66cc86b35mr222749096d6.5.1739857564934; Mon, 17 Feb 2025 21:46:04 -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-6e65d7a4430sm60540986d6.65.2025.02.17.21.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 21:46:04 -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 05CBC1200043; Tue, 18 Feb 2025 00:46:04 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Tue, 18 Feb 2025 00:46:04 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeitdeglecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddt necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepgeeljeeitdehvdehgefgjeevfeejjeekgfev ffeiueejhfeuiefggeeuheeggefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepgh hmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthhopeduiedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgtuhesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehprghulhhmtghksehkvghrnhgvlhdrohhrghdprhgtphhtthho pehfrhgvuggvrhhitgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvvghrrghjrd huphgrughhhigrhieskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhovghlsehjohgv lhhfvghrnhgrnhguvghsrdhorhhgpdhrtghpthhtohepjhhoshhhsehjohhshhhtrhhiph hlvghtthdrohhrghdprhgtphhtthhopegsohhquhhnrdhfvghnghesghhmrghilhdrtgho mhdprhgtphhtthhopehurhgviihkihesghhmrghilhdrtghomhdprhgtphhtthhopehroh hsthgvughtsehgohhoughmihhsrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 18 Feb 2025 00:46:03 -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 , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Joe Perches Subject: [PATCH rcu 7/7] rcu: Remove references to old grace-period-wait primitives Date: Mon, 17 Feb 2025 21:45:47 -0800 Message-Id: <20250218054547.7364-8-boqun.feng@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250218054547.7364-1-boqun.feng@gmail.com> References: <20250218054547.7364-1-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Paul E. McKenney" The rcu_barrier_sched(), synchronize_sched(), and synchronize_rcu_bh() RCU API members have been gone for many years. This commit therefore removes non-historical instances of them. Reported-by: Joe Perches Signed-off-by: Paul E. McKenney Signed-off-by: Boqun Feng --- Documentation/RCU/rcubarrier.rst | 5 +---- include/linux/rcupdate.h | 17 +++++++---------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Documentation/RCU/rcubarrier.rst b/Documentation/RCU/rcubarrier.rst index 6da7f66da2a8..12a7b059654f 100644 --- a/Documentation/RCU/rcubarrier.rst +++ b/Documentation/RCU/rcubarrier.rst @@ -329,10 +329,7 @@ Answer: was first added back in 2005. This is because on_each_cpu() disables preemption, which acted as an RCU read-side critical section, thus preventing CPU 0's grace period from completing - until on_each_cpu() had dealt with all of the CPUs. However, - with the advent of preemptible RCU, rcu_barrier() no longer - waited on nonpreemptible regions of code in preemptible kernels, - that being the job of the new rcu_barrier_sched() function. + until on_each_cpu() had dealt with all of the CPUs. However, with the RCU flavor consolidation around v4.20, this possibility was once again ruled out, because the consolidated diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 48e5c03df1dd..3bb554723074 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -806,11 +806,9 @@ do { \ * sections, invocation of the corresponding RCU callback is deferred * until after the all the other CPUs exit their critical sections. * - * In v5.0 and later kernels, synchronize_rcu() and call_rcu() also - * wait for regions of code with preemption disabled, including regions of - * code with interrupts or softirqs disabled. In pre-v5.0 kernels, which - * define synchronize_sched(), only code enclosed within rcu_read_lock() - * and rcu_read_unlock() are guaranteed to be waited for. + * Both synchronize_rcu() and call_rcu() also wait for regions of code + * with preemption disabled, including regions of code with interrupts or + * softirqs disabled. * * Note, however, that RCU callbacks are permitted to run concurrently * with new RCU read-side critical sections. One way that this can happen @@ -865,11 +863,10 @@ static __always_inline void rcu_read_lock(void) * rcu_read_unlock() - marks the end of an RCU read-side critical section. * * In almost all situations, rcu_read_unlock() is immune from deadlock. - * In recent kernels that have consolidated synchronize_sched() and - * synchronize_rcu_bh() into synchronize_rcu(), this deadlock immunity - * also extends to the scheduler's runqueue and priority-inheritance - * spinlocks, courtesy of the quiescent-state deferral that is carried - * out when rcu_read_unlock() is invoked with interrupts disabled. + * This deadlock immunity also extends to the scheduler's runqueue + * and priority-inheritance spinlocks, courtesy of the quiescent-state + * deferral that is carried out when rcu_read_unlock() is invoked with + * interrupts disabled. * * See rcu_read_lock() for more information. */