From patchwork Tue Oct 10 11:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13415208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C89B5CD80A6 for ; Tue, 10 Oct 2023 11:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231273AbjJJLLG (ORCPT ); Tue, 10 Oct 2023 07:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbjJJLLF (ORCPT ); Tue, 10 Oct 2023 07:11:05 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C678FB4; Tue, 10 Oct 2023 04:11:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75E94C433C9; Tue, 10 Oct 2023 11:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696936263; bh=zrccQti7irl5eqt+h02FBL2SB1o+0Gba/2/xG95iqzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+DGTwDAq8CP86nlASZMFwkTPJx+pjfwriVkWbUEiy/3bioZwoYVKbCT5DEKrRLXg W3oqKdznwjr8+tT95wN1+W3iL7x+lfnrKKQCF3fc4w6aRe6rYpiJLAbj5lf3vZNlgi B6x4zWQ9Y6WBOdaxkNSE0jQSPhIdN9lD56xrTX7qEJqy/A+8x8U03Wqog/fQwGSre6 74Ff8tfr99w+xdXzXh8xw7wKR8pm5m0i/0zoOMiaNw05BG09qnMdGng2nLm0gwFm10 X/rKoawXd6zUWR6ePrSZtiv7WftQV4H81X+IMH6+hNFOvUpKPkCgSGvnhk8G/nKJFy Gpm6v61PcHXtQ== From: Frederic Weisbecker To: LKML Cc: Wei Zhang , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E . McKenney" , Steven Rostedt , Uladzislau Rezki , rcu , Randy Dunlap , Frederic Weisbecker Subject: [PATCH 1/3] Documentation: RCU: Fix section numbers after adding Section 7 in whatisRCU.rst Date: Tue, 10 Oct 2023 13:10:51 +0200 Message-Id: <20231010111053.986507-2-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010111053.986507-1-frederic@kernel.org> References: <20231010111053.986507-1-frederic@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Wei Zhang Signed-off-by: Wei Zhang Reviewed-by: Randy Dunlap Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- Documentation/RCU/whatisRCU.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst index e488c8e557a9..60ce02475142 100644 --- a/Documentation/RCU/whatisRCU.rst +++ b/Documentation/RCU/whatisRCU.rst @@ -59,8 +59,8 @@ experiment with should focus on Section 2. People who prefer to start with example uses should focus on Sections 3 and 4. People who need to understand the RCU implementation should focus on Section 5, then dive into the kernel source code. People who reason best by analogy should -focus on Section 6. Section 7 serves as an index to the docbook API -documentation, and Section 8 is the traditional answer key. +focus on Section 6 and 7. Section 8 serves as an index to the docbook +API documentation, and Section 9 is the traditional answer key. So, start with the section that makes the most sense to you and your preferred method of learning. If you need to know everything about From patchwork Tue Oct 10 11:10:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13415209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 921BFCD80A6 for ; Tue, 10 Oct 2023 11:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231299AbjJJLLI (ORCPT ); Tue, 10 Oct 2023 07:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbjJJLLI (ORCPT ); Tue, 10 Oct 2023 07:11:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792D1B7; Tue, 10 Oct 2023 04:11:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99775C433C7; Tue, 10 Oct 2023 11:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696936266; bh=9iKuAypH43DUxvnbXpZPc2dgGWiCm/Nxs3g2+wjMZ54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jc/XD19T3XpJw9d8eiZM41pJR/YtEhU1RbsWd4HNiYZYM+u/8fYfrkbsEsLzSzoS9 sjOK1rUe5Z0OmZU3wOaJ0BnVGB1pKbToYRugsfscehJBj7hK0V4gv/9uwMgniFdI7d Lje1+mdLML+vyxYpML2y6NtlQkF7EQ11bm2Oonf5Ol5J5wMivmFAOEornBXa3eJoan +Spf8jFvb1ulB5AD1XESR8YyejjSwzRd8v52UjENzEDyv4+Ga/4FjkTq1Yvn1HalX4 j0TNV0yZgnC6qgbSH+1fpj34ALoZlydg/2V4UuoKj2wQY7WEiVJcjqcC9nU+tfI27v Rrhys+jmkvc3Q== From: Frederic Weisbecker To: LKML Cc: "Matthew Wilcox (Oracle)" , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E . McKenney" , Steven Rostedt , Uladzislau Rezki , rcu , Frederic Weisbecker Subject: [PATCH 2/3] rcu: Describe listRCU read-side guarantees Date: Tue, 10 Oct 2023 13:10:52 +0200 Message-Id: <20231010111053.986507-3-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010111053.986507-1-frederic@kernel.org> References: <20231010111053.986507-1-frederic@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: "Matthew Wilcox (Oracle)" More explicitly state what is, and what is not guaranteed to those who iterate a list while protected by RCU. [ paulmck: Apply Joel Fernandes feedback. ] Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- Documentation/RCU/listRCU.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/RCU/listRCU.rst b/Documentation/RCU/listRCU.rst index bdc4bcc5289f..ed5c9d8c9afe 100644 --- a/Documentation/RCU/listRCU.rst +++ b/Documentation/RCU/listRCU.rst @@ -8,6 +8,15 @@ One of the most common uses of RCU is protecting read-mostly linked lists that all of the required memory ordering is provided by the list macros. This document describes several list-based RCU use cases. +When iterating a list while holding the rcu_read_lock(), writers may +modify the list. The reader is guaranteed to see all of the elements +which were added to the list before they acquired the rcu_read_lock() +and are still on the list when they drop the rcu_read_unlock(). +Elements which are added to, or removed from the list may or may not +be seen. If the writer calls list_replace_rcu(), the reader may see +either the old element or the new element; they will not see both, +nor will they see neither. + Example 1: Read-mostly list: Deferred Destruction ------------------------------------------------- From patchwork Tue Oct 10 11:10:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 13415210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E087CD80A6 for ; Tue, 10 Oct 2023 11:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbjJJLLO (ORCPT ); Tue, 10 Oct 2023 07:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbjJJLLN (ORCPT ); Tue, 10 Oct 2023 07:11:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 402E8D8; Tue, 10 Oct 2023 04:11:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EA21C433C8; Tue, 10 Oct 2023 11:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696936268; bh=kMT6jsRDW5u1mR0slm226cMQVQUPEUfKxZwIN7nWu/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNWw///zb6m3i8LiU9IxCovbVxgx2Janpc3MBuSLTcBmgINbbOWyYXNF4jLz8GN36 aaQ3TeIM+/feLx9MIOFmHK9c4Pvi/H591MQZ8e32kIliqegyGtm/0z4QtrTBTL5vMI vNp3xmegu1KCJOgyINVfT28WThykKiWf8bzrbfth3P7e58rHL+P+x641MMG89Ir42j q5xAqZRsN4cje1m0Rwg+3jpmVxXsgvBtzkyFavCT5+ZY0+biSIoh4ljqhVjda2kBQk HIcaCasYvHvAs/1ay5V7ldyNlxJ2rzTxEvOgl6HBAD9bNfqDr59jRXjtC4pGeSFWzs 4QftQvyxiNq2Q== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Boqun Feng , Joel Fernandes , Josh Triplett , Mathieu Desnoyers , Neeraj Upadhyay , "Paul E . McKenney" , Steven Rostedt , Uladzislau Rezki , rcu Subject: [PATCH 3/3] rcu: Remove references to rcu_migrate_callbacks() from diagrams Date: Tue, 10 Oct 2023 13:10:53 +0200 Message-Id: <20231010111053.986507-4-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231010111053.986507-1-frederic@kernel.org> References: <20231010111053.986507-1-frederic@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org This function is gone since: 53b46303da84 (rcu: Remove rsp parameter from rcu_boot_init_percpu_data() and friends) Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- .../Design/Memory-Ordering/TreeRCU-callback-registry.svg | 9 --------- Documentation/RCU/Design/Memory-Ordering/TreeRCU-gp.svg | 9 --------- 2 files changed, 18 deletions(-) diff --git a/Documentation/RCU/Design/Memory-Ordering/TreeRCU-callback-registry.svg b/Documentation/RCU/Design/Memory-Ordering/TreeRCU-callback-registry.svg index 7ac6f9269806..63eff867175a 100644 --- a/Documentation/RCU/Design/Memory-Ordering/TreeRCU-callback-registry.svg +++ b/Documentation/RCU/Design/Memory-Ordering/TreeRCU-callback-registry.svg @@ -564,15 +564,6 @@ font-size="192" id="text202-7-9-6" style="font-size:192px;font-style:normal;font-weight:bold;text-anchor:start;fill:#000000;stroke-width:0.025in;font-family:Courier">rcutree_migrate_callbacks() - rcu_migrate_callbacks() rcutree_migrate_callbacks() - rcu_migrate_callbacks()