From patchwork Wed Mar 15 19:38:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70411 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp87324wrt; Wed, 15 Mar 2023 12:46:02 -0700 (PDT) X-Google-Smtp-Source: AK7set/ZeWh9iYkRkKR4lM5l6ompzJ6qMoG1M7SYdP1tPh9shXu1IupHm6Rezf8vAGvGA94TFs4C X-Received: by 2002:a05:6a20:12ce:b0:cc:beae:c2c2 with SMTP id v14-20020a056a2012ce00b000ccbeaec2c2mr1261840pzg.1.1678909561733; Wed, 15 Mar 2023 12:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678909561; cv=none; d=google.com; s=arc-20160816; b=bPxzI7NYc7rOjFS9tpEvmDdOHixZFjqDPrH4eazDuFISuNraYiGZJpT7LIP4HD8KEa YBut9/pefZ6il9CpeaTei521W7aMWANtyGFTZi0+ASPtoAEh7auGDoxUlLUdI8gjhxY/ xWuDos65C1ep9pJ80xjo/9oR6lCMPjCzI+d+Rn3kpyKF8eogDxVh1PkGl97VyBH7dlgG g1Ea6Q9/mgOs/2IrwxokHysHV+pZzMfFtXfnwbWbKkeljEdBNhew+++IP7bWn3jFsTJP xFpt1yFIpCY4spWRuCHPGqSHzvf91fFfNKARYGTpSJ/j3ulROb/YBrWPnLx1aH9IjCnm sbqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6kodpLrQnSozwTishADT/eFOoqfGUIFhFbZ2Rg+LiOA=; b=mTurUpYq+EBcW5NfNAe6X0EKqk0N3g3V5OV0D4cw+tnxb1m/q62Stg7X4q2KEjUz0y fANhtQuHZQzXJz5TBUSQQvHcYxdTvkAg6Pj3J0tsnsrUXt4cWE5cQmqjiERsJ2bGfz5V 28xxzhmaN1Wv3FsCcLnTJr3mxBvhg8rI/Qlg/SMcD1aC2TeKEagS9NEwjy6Yqhazpv1m dpVlHE26gXFShQZ+p3grHpRvdlk5OkMPLzsGWjhXyh+lhaHhiHZ0Qqk3f793uzXxWq4N RbRt3vl0/iSxnhNRLnlD8rZuY+sN3t0n7AYVfL26Iuh3u9y69jSA+GsAZXsPojO+2S3F 4wAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WByS267g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020aa79af5000000b00577c17000dasi5681171pfp.166.2023.03.15.12.45.47; Wed, 15 Mar 2023 12:46:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WByS267g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232285AbjCOTj1 (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232308AbjCOTjN (ORCPT ); Wed, 15 Mar 2023 15:39:13 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514CE12BC6 for ; Wed, 15 Mar 2023 12:39:12 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id y3so17388537qvn.4 for ; Wed, 15 Mar 2023 12:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909151; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6kodpLrQnSozwTishADT/eFOoqfGUIFhFbZ2Rg+LiOA=; b=WByS267g9t6NJ1kyG9/EnjmxtgTNYbezAKGqyr8CaaBwqZINFEuA/ntWN6H+6kcZlm 0y0pivfDEqSC6+oWTYuc4+m0Ve4R+syrQBMCVHz35BK+o7Fx/qDMRs/tpQIZtjbMvVYM Z/STPa8OKdawLzzW22yLDCHQE1elXduZpbeGw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909151; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6kodpLrQnSozwTishADT/eFOoqfGUIFhFbZ2Rg+LiOA=; b=3ob0NbFjgs5R2Vq+PceAaX5BCewJ0jJdoxOqy+CYfetsVL9HgZ8Pj3328Jqqcr4W6T S7XfeLScLBhNBvOOB6zNS3L0FGoboI/MDKCB3eQjzNcu/Zn2REchqz/xrldQyFXXGIF3 OBkqj/QjeB2DcUJANEG+M6UUygwIL/7957qmWWnXuz1YQ5AUSf2FKKPcN6JkKPvhe5kd 6DnQ6A1XrbUHc5kCxM1HXmvynalwSoYjMxNUsNuyuMYFNzyhgNXn/IJS2AhbGhC0UaBj WLJR5fOOzWQ+2nIePfVWFX3hKlflJ3286JwKJb/mzIuR1a0iYcd44QIFC8E5XpCtweRy yuuQ== X-Gm-Message-State: AO0yUKULTpoWKF4lVkfqYn7sbkc4eQ/K4MKBwKLFGS5jcNnPqJwM9UZa o9uHuR/15q8xuLOwNrua4zKR3BgPAIVbcb37wAc= X-Received: by 2002:a05:6214:20a7:b0:56e:fb4c:c1c4 with SMTP id 7-20020a05621420a700b0056efb4cc1c4mr32374960qvd.14.1678909151167; Wed, 15 Mar 2023 12:39:11 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:10 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers Cc: Pingfan Liu , Frederic Weisbecker , "Zhang, Qiang1" , Joel Fernandes , rcu@vger.kernel.org Subject: [PATCH 1/6] srcu: Add comments for srcu_size_state Date: Wed, 15 Mar 2023 19:38:46 +0000 Message-Id: <20230315193851.8598-1-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760464272373357575?= X-GMAIL-MSGID: =?utf-8?q?1760464272373357575?= From: Pingfan Liu The SRCU_SIZE_* names are not self-explanatory, so this commit therefore adds comments to the definitions. Signed-off-by: Pingfan Liu Cc: Lai Jiangshan Cc: "Paul E. McKenney" Cc: Frederic Weisbecker Cc: Josh Triplett Cc: Steven Rostedt Cc: Mathieu Desnoyers Cc: "Zhang, Qiang1" To: rcu@vger.kernel.org Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/srcutree.h | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h index 558057b517b7..a6910805f9c5 100644 --- a/include/linux/srcutree.h +++ b/include/linux/srcutree.h @@ -92,16 +92,29 @@ struct srcu_struct { struct lockdep_map dep_map; }; -/* Values for size state variable (->srcu_size_state). */ -#define SRCU_SIZE_SMALL 0 -#define SRCU_SIZE_ALLOC 1 -#define SRCU_SIZE_WAIT_BARRIER 2 -#define SRCU_SIZE_WAIT_CALL 3 -#define SRCU_SIZE_WAIT_CBS1 4 -#define SRCU_SIZE_WAIT_CBS2 5 -#define SRCU_SIZE_WAIT_CBS3 6 -#define SRCU_SIZE_WAIT_CBS4 7 -#define SRCU_SIZE_BIG 8 +// Values for size state variable (->srcu_size_state). Once the state +// has been set to SRCU_SIZE_ALLOC, the grace-period code advances through +// this state machine one step per grace period until the SRCU_SIZE_BIG state +// is reached. Otherwise, the state machine remains in the SRCU_SIZE_SMALL +// state indefinitely. +#define SRCU_SIZE_SMALL 0 // No srcu_node combining tree, ->node == NULL +#define SRCU_SIZE_ALLOC 1 // An srcu_node tree is being allocated, initialized, + // and then referenced by ->node. It will not be used. +#define SRCU_SIZE_WAIT_BARRIER 2 // The srcu_node tree starts being used by everything + // except call_srcu(), especially by srcu_barrier(). + // By the end of this state, all CPUs and threads + // are aware of this tree's existence. +#define SRCU_SIZE_WAIT_CALL 3 // The srcu_node tree starts being used by call_srcu(). + // By the end of this state, all of the call_srcu() + // invocations that were running on a non-boot CPU + // and using the boot CPU's callback queue will have + // completed. +#define SRCU_SIZE_WAIT_CBS1 4 // Don't trust the ->srcu_have_cbs[] grace-period +#define SRCU_SIZE_WAIT_CBS2 5 // sequence elements or the ->srcu_data_have_cbs[] +#define SRCU_SIZE_WAIT_CBS3 6 // CPU-bitmask elements until all four elements of +#define SRCU_SIZE_WAIT_CBS4 7 // each array have been initialized. +#define SRCU_SIZE_BIG 8 // The srcu_node combining tree is fully initialized + // and all aspects of it are being put to use. /* Values for state variable (bottom bits of ->srcu_gp_seq). */ #define SRCU_STATE_IDLE 0 From patchwork Wed Mar 15 19:38:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp87280wrt; Wed, 15 Mar 2023 12:45:54 -0700 (PDT) X-Google-Smtp-Source: AK7set90hsXJfsz8mA0axa36bLZaQ0/Iamw7HH5XgVOb1x1CSGOYS4XBmG8ZLybhjlaxQLJfm4Pz X-Received: by 2002:a62:1915:0:b0:624:7c9a:c832 with SMTP id 21-20020a621915000000b006247c9ac832mr685839pfz.8.1678909554102; Wed, 15 Mar 2023 12:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678909554; cv=none; d=google.com; s=arc-20160816; b=cVBShRAkXPukuueJAYBGBcjbkor/K7WnP3xlbhkRL1tv/+GDfmFNK666Z/eiE8A5EU EZbxGG4An25aMYqB6YidU2i07jd/jqwEuioVnj5E2Xm751f/V3oBOhEPWQrXvM8lxCEH wkbgI+UZOzvO3IU5qQ+3ed4B9ptH8FFnCIJf6jv6nnJL5tfVUd3fvufZcpwRVpi0nX0o 9Jj3BJsuGCsSI9L3LB4W3mOCP7rPvTnjS+nTRav3/OQhiFEjqDfkf4sQUIKg6UHYPyFD ysoEaUFpVkPpunQ1Sm0LK9gEXekcV8u7BfCWpUVG7e5bjzso5ml1CbtjPmqeLJ+etDkz jM5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gkIW82Jn8PaGpB7B+YMqBxYys/Ya8U+pTY1r1WqXQ8E=; b=k8BqhiDoWl5cHbz35vuKLAiVwEPI193yZo71BKYHMEUONhx7ThPhfHC0Uk01iVr21S 8n/nwtxwaTgUsiCZEe4vYum+voZUrp89mGiX/QANYJhWkc/TaKWzkUjTkvy+J9pU5SCr miu3FEHcn99bH2/5rY3sqVSFVzrrLZ309hBw5kP+6oJRxImDdb/w2bB+hgN3EMFD1uYU xVYEQPunCnS0ynQjWTCnMtWjMZXvad/kc6+62Ew4QRLQ5JpO5tjCeMrwgguUcpTEQ3eL IxoIUty2rLSKfWd+b1igiofkguEvlm23rP6kAlwMDtjpqd1rVM0Kijo1+ulXPwlBvEIH +jZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WDyMAh8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a63d34e000000b005031231026fsi5535859pgi.543.2023.03.15.12.45.40; Wed, 15 Mar 2023 12:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WDyMAh8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232619AbjCOTja (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232475AbjCOTjP (ORCPT ); Wed, 15 Mar 2023 15:39:15 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B33A95BD92 for ; Wed, 15 Mar 2023 12:39:13 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id r5so17488804qtp.4 for ; Wed, 15 Mar 2023 12:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gkIW82Jn8PaGpB7B+YMqBxYys/Ya8U+pTY1r1WqXQ8E=; b=WDyMAh8LBvLv8TcPocJTlQ9oUFNWyhm52mv3Oy3aloVLjA3GPz2f/kf8L3QTmisA+e vZgmipdZ/oNQKbH4mBAG642qB5ciV2dFTAwbxCn78S00oXbU2BV2vHJUJJN4nLcJXPcT yt/KduCRJHeohmdt8cRIjsM2rwQYsvJ1QusRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gkIW82Jn8PaGpB7B+YMqBxYys/Ya8U+pTY1r1WqXQ8E=; b=VMFDAxSFmXw+7PRoqinn3+6cUTYdiWV2iR+fSRwvGOKvCf+xwWPrLX4eyXm1O3QKR+ EWv2wXllDmzbdXqpLpMhefJdhiDVUHUL6ZdkCBsKSlKw+obFlRMzcvXnDqERF7o2iLmM HxJEcry2Qbs3pSI1sfGK+VVICzDl5krb3mnYlI7wSW/jHk1NADRJ/sQLzy4Eu70+WpSE +MfHUgg1M/kzMG/U0YppP8HlDaucxwXs3KrRKFxuZa43MX2omdRHMPakTTi+yDO48inw M0UQZuCgewac4IibFJSut4rs/rql2V8rdu/R+0PU2EFcbh2M46OrvLw9Mv/jsEVgqXNX oZXA== X-Gm-Message-State: AO0yUKXKw2re5XNqbIMAYl9QKr+aBD3oFsddvWR9UEUHXg+VvpWn2rcQ h3g+iWkkRE8Ce65lypqGUCPxkpffE0I2kzf3DTY= X-Received: by 2002:a05:622a:284:b0:3bd:140c:91ed with SMTP id z4-20020a05622a028400b003bd140c91edmr1637192qtw.52.1678909152452; Wed, 15 Mar 2023 12:39:12 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:11 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Jonathan Corbet Cc: Qiuxu Zhuo , rcu@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 2/6] Documentation/RCU: s/not/note/ in checklist.rst Date: Wed, 15 Mar 2023 19:38:47 +0000 Message-Id: <20230315193851.8598-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230315193851.8598-1-joel@joelfernandes.org> References: <20230315193851.8598-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760464264364573066?= X-GMAIL-MSGID: =?utf-8?q?1760464264364573066?= From: Qiuxu Zhuo "Please not that you *cannot* rely..." has a typo. Fix it. Signed-off-by: Qiuxu Zhuo Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/checklist.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/checklist.rst b/Documentation/RCU/checklist.rst index cc361fb01ed4..bd3c58c44bef 100644 --- a/Documentation/RCU/checklist.rst +++ b/Documentation/RCU/checklist.rst @@ -70,7 +70,7 @@ over a rather long period of time, but improvements are always welcome! can serve as rcu_read_lock_sched(), but is less readable and prevents lockdep from detecting locking issues. - Please not that you *cannot* rely on code known to be built + Please note that you *cannot* rely on code known to be built only in non-preemptible kernels. Such code can and will break, especially in kernels built with CONFIG_PREEMPT_COUNT=y. From patchwork Wed Mar 15 19:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp100551wrt; Wed, 15 Mar 2023 13:16:18 -0700 (PDT) X-Google-Smtp-Source: AK7set+HzXCUTpizMrrQllujait29uUKjthKTpXAbF1MrUNvcevf0nEM5ObRgrh4LF5UBdqEMium X-Received: by 2002:a05:6871:82c:b0:17a:bf1b:cab8 with SMTP id q44-20020a056871082c00b0017abf1bcab8mr2269162oap.4.1678911378322; Wed, 15 Mar 2023 13:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678911378; cv=none; d=google.com; s=arc-20160816; b=BNC/H2J3OlfBf6UEdSbzSZoYOs6rpAVnKk7o3XlH+PYA4gd173STmcOMcEE7zGfEB4 Ehu3uA/QS8pr+oYI8PfPN9e/EEAM5qQDZYqLQ6wjSMtmjuc9ni641yWjPbGvbRVIZdhx 6t+K3yXzT2WeuM8/3grbv1sNPQodgV+ZgHo/8O7/VB2PKPcLGg2TVCj24g9/foUZUUA2 6t5pD33K2fYbEdfEX+oZLFNmq6Oq1g4qzJjySYtHfrWVbcy6Ikb8ha1koiZST3DPMmKY FtsLLW7JQNl95dTuPSHtDgYBfzRqtPMO2A9iZ5fm63BaDzrNPOxEYe0A1m0oIRnGhYYh McmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=toQXaUPvgeCcBAYiqMckeG88YIHFRuFoSXsrXPxs/ek=; b=f+Uet/Y5WlPbrzOmPIiT6qPRhAyCbtzyOItEBi/L8icMWokFzHsIiP4pTJXHizqAV7 VJJHqOIGa1QidWeBFeYImyBlFUAe7FHAIXf1nCrxrN0mvvyCkMzNdwVq7wb1DDgYahY/ Ni5nbJnrpE2+rgLs19HCU98oynZJt5eBBT/BbboCBWyrOVzCCGQQQVtanzxNZEUs+JU8 KqdtuKCIP8A+3MkrohonSPUhTXXK/8prZoXy1XVLHtTRqb76xV8f1wtrXk82ohgNoOLm Ga+oQTWrKGXyWaj+GemQeoWGe+DdAXLpy3H/cD/a5bArGb02kGJ7DKz5moNZKZp51r8x k25Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aabRxvDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba4-20020a056870c58400b00177be1a8346si5428284oab.243.2023.03.15.13.16.03; Wed, 15 Mar 2023 13:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=aabRxvDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232750AbjCOTjd (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232543AbjCOTjR (ORCPT ); Wed, 15 Mar 2023 15:39:17 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A161EBC1 for ; Wed, 15 Mar 2023 12:39:14 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id n2so1332869qtp.0 for ; Wed, 15 Mar 2023 12:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=toQXaUPvgeCcBAYiqMckeG88YIHFRuFoSXsrXPxs/ek=; b=aabRxvDGfMHTAOu1rCeWRfKFoj8/e+eofwzwu8sq5N2xxVoIbfEUCAmOtm4OtV0cEM 3LC2KDAp5IS7KK4K4qQLtxP+KXkQLpgZCw7uQ3zAxC4x1kEb19UNY5xIzVJMNoBQ+28S TFUhDoS/SN+A3vUukWz6JmpFnyeYUZO7AUhd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=toQXaUPvgeCcBAYiqMckeG88YIHFRuFoSXsrXPxs/ek=; b=UWbwhqfU4+Zvb+R1hgERQoYiF4wdL3GB3Sfs36wdZ2BL0P/0FHCGYT2dj1DmU7mB7o h+UEN+O54nLVHPOFtPa9F/hicsVCvo3UeolgtV54E5fsaS50YGZMFxxqhfvHcMSKvwxP GHGE5N8+2g7Vj2+NW6qqsCqKmDKqWbFaYv3qrbEDV13pnzj+mP45Fi00EGk4VDqGMKfP pzezbWIm0zvPl0yq9uOmTOjekIenRUN3ymM2Sm6ZmraT8TDjiIGt3a1mEQqKJ0U1VWst XTwSldwlzRZsRf4x1b2G/jWWV1MNa9wPMvevpCYsGSaaKcDwTWAoe/gei1kBasPNF7Bt rmGQ== X-Gm-Message-State: AO0yUKVUIHvfUoRHQ+tN1ULrbs/decUIgExlR5Qd7EZciqvd8SE7pvjD 19N018hgZCmK7jvM4SSJgUkhhLkYdGFjdazIZj0= X-Received: by 2002:a05:622a:1d5:b0:3b9:b761:b0a0 with SMTP id t21-20020a05622a01d500b003b9b761b0a0mr2005215qtw.12.1678909153579; Wed, 15 Mar 2023 12:39:13 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:13 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers Cc: "Joel Fernandes (Google)" , Frederic Weisbecker , Boqun Feng , rcu@vger.kernel.org Subject: [PATCH 3/6] srcu: Clarify comments on memory barrier "E" Date: Wed, 15 Mar 2023 19:38:48 +0000 Message-Id: <20230315193851.8598-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230315193851.8598-1-joel@joelfernandes.org> References: <20230315193851.8598-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760466177156252613?= X-GMAIL-MSGID: =?utf-8?q?1760466177156252613?= There is an smp_mb() named "E" in srcu_flip() immediately before the increment (flip) of the srcu_struct structure's ->srcu_idx. The purpose of E is to order the preceding scan's read of lock counters against the flipping of the ->srcu_idx, in order to prevent new readers from continuing to use the old ->srcu_idx value, which might needlessly extend the grace period. However, this ordering is already enforced because of the control dependency between the preceding scan and the ->srcu_idx flip. This control dependency exists because atomic_long_read() is used to scan the counts, because WRITE_ONCE() is used to flip ->srcu_idx, and because ->srcu_idx is not flipped until the ->srcu_lock_count[] and ->srcu_unlock_count[] counts match. And such a match cannot happen when there is an in-flight reader that started before the flip (observation courtesy Mathieu Desnoyers). The litmus test below (courtesy of Frederic Weisbecker, with changes for ctrldep by Boqun and Joel) shows this: C srcu (* * bad condition: P0's first scan (SCAN1) saw P1's idx=0 LOCK count inc, though P1 saw flip. * * So basically, the ->po ordering on both P0 and P1 is enforced via ->ppo * (control deps) on both sides, and both P0 and P1 are interconnected by ->rf * relations. Combining the ->ppo with ->rf, a cycle is impossible. *) {} // updater P0(int *IDX, int *LOCK0, int *UNLOCK0, int *LOCK1, int *UNLOCK1) { int lock1; int unlock1; int lock0; int unlock0; // SCAN1 unlock1 = READ_ONCE(*UNLOCK1); smp_mb(); // A lock1 = READ_ONCE(*LOCK1); // FLIP if (lock1 == unlock1) { // Control dep smp_mb(); // E // Remove E and still passes. WRITE_ONCE(*IDX, 1); smp_mb(); // D // SCAN2 unlock0 = READ_ONCE(*UNLOCK0); smp_mb(); // A lock0 = READ_ONCE(*LOCK0); } } // reader P1(int *IDX, int *LOCK0, int *UNLOCK0, int *LOCK1, int *UNLOCK1) { int tmp; int idx1; int idx2; // 1st reader idx1 = READ_ONCE(*IDX); if (idx1 == 0) { // Control dep tmp = READ_ONCE(*LOCK0); WRITE_ONCE(*LOCK0, tmp + 1); smp_mb(); /* B and C */ tmp = READ_ONCE(*UNLOCK0); WRITE_ONCE(*UNLOCK0, tmp + 1); } else { tmp = READ_ONCE(*LOCK1); WRITE_ONCE(*LOCK1, tmp + 1); smp_mb(); /* B and C */ tmp = READ_ONCE(*UNLOCK1); WRITE_ONCE(*UNLOCK1, tmp + 1); } } exists (0:lock1=1 /\ 1:idx1=1) More complicated litmus tests with multiple SRCU readers also show that memory barrier E is not needed. This commit therefore clarifies the comment on memory barrier E. Why not also remove that redundant smp_mb()? Because control dependencies are quite fragile due to their not being recognized by most compilers and tools. Control dependencies therefore exact an ongoing maintenance burden, and such a burden cannot be justified in this slowpath. Therefore, that smp_mb() stays until such time as its overhead becomes a measurable problem in a real workload running on a real production system, or until such time as compilers start paying attention to this sort of control dependency. Co-developed-by: Frederic Weisbecker Signed-off-by: Frederic Weisbecker Co-developed-by: Mathieu Desnoyers Signed-off-by: Mathieu Desnoyers Co-developed-by: Boqun Feng Signed-off-by: Boqun Feng Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/srcutree.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index ab4ee58af84b..68f89c533057 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -1085,16 +1085,36 @@ static bool try_check_zero(struct srcu_struct *ssp, int idx, int trycount) static void srcu_flip(struct srcu_struct *ssp) { /* - * Ensure that if this updater saw a given reader's increment - * from __srcu_read_lock(), that reader was using an old value - * of ->srcu_idx. Also ensure that if a given reader sees the - * new value of ->srcu_idx, this updater's earlier scans cannot - * have seen that reader's increments (which is OK, because this - * grace period need not wait on that reader). + * Because the flip of ->srcu_idx is executed only if the + * preceding call to srcu_readers_active_idx_check() found that + * the ->srcu_unlock_count[] and ->srcu_lock_count[] sums matched + * and because that summing uses atomic_long_read(), there is + * ordering due to a control dependency between that summing and + * the WRITE_ONCE() in this call to srcu_flip(). This ordering + * ensures that if this updater saw a given reader's increment from + * __srcu_read_lock(), that reader was using a value of ->srcu_idx + * from before the previous call to srcu_flip(), which should be + * quite rare. This ordering thus helps forward progress because + * the grace period could otherwise be delayed by additional + * calls to __srcu_read_lock() using that old (soon to be new) + * value of ->srcu_idx. + * + * This sum-equality check and ordering also ensures that if + * a given call to __srcu_read_lock() uses the new value of + * ->srcu_idx, this updater's earlier scans cannot have seen + * that reader's increments, which is all to the good, because + * this grace period need not wait on that reader. After all, + * if those earlier scans had seen that reader, there would have + * been a sum mismatch and this code would not be reached. + * + * This means that the following smp_mb() is redundant, but + * it stays until either (1) Compilers learn about this sort of + * control dependency or (2) Some production workload running on + * a production system is unduly delayed by this slowpath smp_mb(). */ smp_mb(); /* E */ /* Pairs with B and C. */ - WRITE_ONCE(ssp->srcu_idx, ssp->srcu_idx + 1); + WRITE_ONCE(ssp->srcu_idx, ssp->srcu_idx + 1); // Flip the counter. /* * Ensure that if the updater misses an __srcu_read_unlock() From patchwork Wed Mar 15 19:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp89962wrt; Wed, 15 Mar 2023 12:52:51 -0700 (PDT) X-Google-Smtp-Source: AK7set9BE2ziyN0l1kLTX42kdqIThyfUGvRbQomODvsog9uxY5EeTYgGULBMs8bHclpLIt7aLpa/ X-Received: by 2002:a17:90b:4f90:b0:23b:4bf6:bbfa with SMTP id qe16-20020a17090b4f9000b0023b4bf6bbfamr1076010pjb.11.1678909970821; Wed, 15 Mar 2023 12:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678909970; cv=none; d=google.com; s=arc-20160816; b=oiboG4HfLh9PMZLAu4a0sbDkoJn77xxPxe1A2jBKt1QgZwk2hhxSn7UUGt2gJwD23n LOnunhRjRo1+FT3sdihZmkZNsfrzUp7FOntW5rapTDyEg6ZFSozvJ+sDSB7LNLiujt01 kj7mPrlsqTrardqhMHmrec6Cb6OGSlZ9Q/+ujuMtBcyLUYFPuinpYSCU9pahyHfBUGi1 R6qrimcg8lgHW053C2OY79iK0qhfB90nJ83xS6wjXqAxeeYtDUx3qp4jYx4aXZrUNasf nd8rc0qp7c+wW4M1dKBU6scaXt3oEiHqApVVWIqj6yPX9zJd08k13YcjQ7SocFCiDIs/ ZM9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FZQhYsvSmWyuhycEwUPUuLVCJi5L/larxVRjodrPgYU=; b=VBvJeyslj4bwUAlg6wXY3WuLQHeL6ZTQpPew43GifhSu8zC11ql4/P+mVbwKcAUDlf JtzPBSkqoxKS+xmzq5T0xIIdjgH0GOm3WtDAJcnoIUKXZqFF+xGwnYOj5ESCnni4/b98 DtilJmKtrU1GE7rRURydQ2ffeZDBZ/ave4KmkRH4XBNLGT2L5bLl8tOnfD8uS7gQZtP8 q9iPVO6DwKoJDNraPIESzFqaA2uU1PxyUhCQMiFuz8XN5KNBIybvlEQhiR9GhBBBlAb4 Z09phXn/D/RM4bxaY8mPTOaaqOW1ieryX2JMmFODzxAVj5wvoHARFdFJXOjLC49Q9XuO FNlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WPzp7vzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020a63924d000000b0050bd71e8618si3389923pgn.848.2023.03.15.12.52.38; Wed, 15 Mar 2023 12:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=WPzp7vzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbjCOTjh (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbjCOTjZ (ORCPT ); Wed, 15 Mar 2023 15:39:25 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA3CB61A96 for ; Wed, 15 Mar 2023 12:39:16 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id 97so4420129qvb.6 for ; Wed, 15 Mar 2023 12:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FZQhYsvSmWyuhycEwUPUuLVCJi5L/larxVRjodrPgYU=; b=WPzp7vzhgULJB2A4jk1YcDWNT1jobRT1Ako/o+cRiCARG56+shVqIoIt4PgSos4evO FIJjUyWumnqa5ztJqHnm/Bl0SN05mH5YBYPmo5nO/7nl+Dg4qzpD8ZJdUeQmDXg3a3l+ 07fArh0ALdM0jYUmpKU1a4ZPhZK8IyVKtz3LQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FZQhYsvSmWyuhycEwUPUuLVCJi5L/larxVRjodrPgYU=; b=T4SLCTFWPtQewCizXKzCKbsTd5X3/nA5kNaSYYWD1krKWZCPP5q38T3tsz2yEp2W0K Ty060N5NUiiOvogNPDY61PNXxXMrl1vzPWAtPHtNBNoRZQxM1pogBNPl0rufTxJcsrbU 7VSNFuDblnb0563f774ndLaHQq3jqgPGggozGBZFyB1OI+oz0Qva2bZ+Q6/8QRlxiilz hO9aL5i2i9yZMSmxyDR1ItPsI+KIzOPKesHcfslF6l0hmJzh9umUR6Xad3p/fQj3YTR6 s2NEmvF7XefZkuBPjo7HahgK1vx2nn/r1xha/4z6ozlnzORMz1FFKYLRCCUrgbMtD1J8 8QpA== X-Gm-Message-State: AO0yUKVKWDVdGPZ4JWe3SlNIDrwGmHgSxw3xNPO+SidntKKz/Nhzypvy HCjh5/SF68yLOdJAwudAT9s2N2UvVW81vqIZiKU= X-Received: by 2002:a05:6214:1d0b:b0:5ab:f46:e094 with SMTP id e11-20020a0562141d0b00b005ab0f46e094mr16549743qvd.49.1678909155498; Wed, 15 Mar 2023 12:39:15 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:15 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Jonathan Corbet , Davidlohr Bueso Cc: Randy Dunlap , linux-doc@vger.kernel.org, rcu@vger.kernel.org Subject: [PATCH 4/6] Documentation: RCU: Correct spelling Date: Wed, 15 Mar 2023 19:38:49 +0000 Message-Id: <20230315193851.8598-4-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230315193851.8598-1-joel@joelfernandes.org> References: <20230315193851.8598-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760464701231976866?= X-GMAIL-MSGID: =?utf-8?q?1760464701231976866?= From: Randy Dunlap Correct spelling problems for Documentation/RCU/ as reported by codespell. Note: in RTFP.txt, there are other misspellings that are left as is since they were used that way in email Subject: lines or in LWN.net articles. [preemptable, Preemptable, synchonisation] Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: "Paul E. McKenney" Cc: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Josh Triplett Cc: rcu@vger.kernel.org Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- .../Expedited-Grace-Periods.rst | 6 +++--- .../Memory-Ordering/Tree-RCU-Memory-Ordering.rst | 2 +- Documentation/RCU/RTFP.txt | 10 +++++----- Documentation/RCU/UP.rst | 4 ++-- Documentation/RCU/lockdep.rst | 2 +- Documentation/RCU/torture.rst | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.rst b/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.rst index c9c957c85bac..93d899d53258 100644 --- a/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.rst +++ b/Documentation/RCU/Design/Expedited-Grace-Periods/Expedited-Grace-Periods.rst @@ -277,7 +277,7 @@ the following access functions: Again, only one request in a given batch need actually carry out a grace-period operation, which means there must be an efficient way to -identify which of many concurrent reqeusts will initiate the grace +identify which of many concurrent requests will initiate the grace period, and that there be an efficient way for the remaining requests to wait for that grace period to complete. However, that is the topic of the next section. @@ -405,7 +405,7 @@ Use of Workqueues In earlier implementations, the task requesting the expedited grace period also drove it to completion. This straightforward approach had the disadvantage of needing to account for POSIX signals sent to user -tasks, so more recent implemementations use the Linux kernel's +tasks, so more recent implementations use the Linux kernel's workqueues (see Documentation/core-api/workqueue.rst). The requesting task still does counter snapshotting and funnel-lock @@ -465,7 +465,7 @@ corresponding disadvantage that workqueues cannot be used until they are initialized, which does not happen until some time after the scheduler spawns the first task. Given that there are parts of the kernel that really do want to execute grace periods during this mid-boot “dead -zone”, expedited grace periods must do something else during thie time. +zone”, expedited grace periods must do something else during this time. What they do is to fall back to the old practice of requiring that the requesting task drive the expedited grace period, as was the case before diff --git a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst index 7fdf151a8680..5750f125361b 100644 --- a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst +++ b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst @@ -168,7 +168,7 @@ an ``atomic_add_return()`` of zero) to detect idle CPUs. +-----------------------------------------------------------------------+ The approach must be extended to handle one final case, that of waking a -task blocked in ``synchronize_rcu()``. This task might be affinitied to +task blocked in ``synchronize_rcu()``. This task might be affined to a CPU that is not yet aware that the grace period has ended, and thus might not yet be subject to the grace period's memory ordering. Therefore, there is an ``smp_mb()`` after the return from diff --git a/Documentation/RCU/RTFP.txt b/Documentation/RCU/RTFP.txt index 588d97366a46..db8f16b392aa 100644 --- a/Documentation/RCU/RTFP.txt +++ b/Documentation/RCU/RTFP.txt @@ -201,7 +201,7 @@ work looked at debugging uses of RCU [Seyster:2011:RFA:2075416.2075425]. In 2012, Josh Triplett received his Ph.D. with his dissertation covering RCU-protected resizable hash tables and the relationship between memory barriers and read-side traversal order: If the updater -is making changes in the opposite direction from the read-side traveral +is making changes in the opposite direction from the read-side traversal order, the updater need only execute a memory-barrier instruction, but if in the same direction, the updater needs to wait for a grace period between the individual updates [JoshTriplettPhD]. Also in 2012, @@ -1245,7 +1245,7 @@ Oregon Health and Sciences University" [Viewed September 5, 2005]" ,annotation={ First posting showing how RCU can be safely adapted for - preemptable RCU read side critical sections. + preemptible RCU read side critical sections. } } @@ -1888,7 +1888,7 @@ Revised: \url{https://lore.kernel.org/r/20070910183004.GA3299@linux.vnet.ibm.com} [Viewed October 25, 2007]" ,annotation={ - Final patch for preemptable RCU to -rt. (Later patches were + Final patch for preemptible RCU to -rt. (Later patches were to mainline, eventually incorporated.) } } @@ -2275,7 +2275,7 @@ lot of {Linux} into your technology!!!" \url{https://lore.kernel.org/r/20090724001429.GA17374@linux.vnet.ibm.com} [Viewed August 15, 2009]" ,annotation={ - First posting of simple and fast preemptable RCU. + First posting of simple and fast preemptible RCU. } } @@ -2639,7 +2639,7 @@ lot of {Linux} into your technology!!!" RCU-protected hash tables, barriers vs. read-side traversal order. . If the updater is making changes in the opposite direction from - the read-side traveral order, the updater need only execute a + the read-side traversal order, the updater need only execute a memory-barrier instruction, but if in the same direction, the updater needs to wait for a grace period between the individual updates. diff --git a/Documentation/RCU/UP.rst b/Documentation/RCU/UP.rst index 8b20fd45f255..4060d7a2f62a 100644 --- a/Documentation/RCU/UP.rst +++ b/Documentation/RCU/UP.rst @@ -107,7 +107,7 @@ UP systems, including PREEMPT SMP builds running on UP systems. Quick Quiz #3: Why can't synchronize_rcu() return immediately on UP systems running - preemptable RCU? + preemptible RCU? .. _answer_quick_quiz_up: @@ -143,7 +143,7 @@ Answer to Quick Quiz #2: Answer to Quick Quiz #3: Why can't synchronize_rcu() return immediately on UP systems - running preemptable RCU? + running preemptible RCU? Because some other task might have been preempted in the middle of an RCU read-side critical section. If synchronize_rcu() diff --git a/Documentation/RCU/lockdep.rst b/Documentation/RCU/lockdep.rst index 2749f43ec1b0..69e73a39bd11 100644 --- a/Documentation/RCU/lockdep.rst +++ b/Documentation/RCU/lockdep.rst @@ -65,7 +65,7 @@ checking of rcu_dereference() primitives: rcu_access_pointer(p): Return the value of the pointer and omit all barriers, but retain the compiler constraints that prevent duplicating - or coalescsing. This is useful when testing the + or coalescing. This is useful when testing the value of the pointer itself, for example, against NULL. The rcu_dereference_check() check expression can be any boolean diff --git a/Documentation/RCU/torture.rst b/Documentation/RCU/torture.rst index 0316ba0c6922..b3b6dfa85248 100644 --- a/Documentation/RCU/torture.rst +++ b/Documentation/RCU/torture.rst @@ -216,7 +216,7 @@ Kernel boot arguments can also be supplied, for example, to control rcutorture's module parameters. For example, to test a change to RCU's CPU stall-warning code, use "--bootargs 'rcutorture.stall_cpu=30'". This will of course result in the scripting reporting a failure, namely -the resuling RCU CPU stall warning. As noted above, reducing memory may +the resulting RCU CPU stall warning. As noted above, reducing memory may require disabling rcutorture's callback-flooding tests:: kvm.sh --cpus 448 --configs '56*TREE04' --memory 128M \ @@ -370,5 +370,5 @@ You can also re-run a previous remote run in a manner similar to kvm.sh: tools/testing/selftests/rcutorture/res/2022.11.03-11.26.28-remote \ --duration 24h -In this case, most of the kvm-again.sh parmeters may be supplied following +In this case, most of the kvm-again.sh parameters may be supplied following the pathname of the old run-results directory. From patchwork Wed Mar 15 19:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp91249wrt; Wed, 15 Mar 2023 12:55:57 -0700 (PDT) X-Google-Smtp-Source: AK7set8M9/iLX23GZBjjVQ+eZSqyc/NIGW+BJZ5tB9Pw51jjyNpnZK3hHrKrdf5z1st276BLXr4M X-Received: by 2002:a17:903:2342:b0:19c:be03:d0ba with SMTP id c2-20020a170903234200b0019cbe03d0bamr776066plh.18.1678910157233; Wed, 15 Mar 2023 12:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678910157; cv=none; d=google.com; s=arc-20160816; b=enGryvCaJQ+6k9617Ktvt3RaPqVL3G4IdHp2hzphtTHisYmF28xwUeIdG1uUmE12vg nAxhdxDxh5DPmEhUx/Ng/RLXJGfgw0RmyeWgsjwsmw3Jab8Zo2KzAEUgMfA3gkPscAGX hrNylx8Sr5Lhb00ldRJB2mb8m5noDTwzUaT+TcDsxp3S2rcy0YUOktVmqsKLUTaMdmeI fMRGJXwNHvUP89zMUgJtMBpNvoGNrjB0wqtW6hLg4pfdlIw69TuMI2iAll5yu9TTUo7Z KCwZ1zp7Xh/DJc5nB67M/eSOQF1irx0S6qe7KWAKJ8ox9wA959sepbXM2kiixsGqogmU lPSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=axV3b7MOxr7kX8qyghaLBRtLrKYOLo8UOyKWzHAv10o=; b=U/DLV93uAP/1HIgsKSMEF2gwLzzto6JHit20ghxdXWxtd5Id3e8ia/8xbMxkPbY9mw SMwPqlehb4ChnDe6/UAsXsTgw1pC5qE65XyS0s5847x1xkwfO/mwVEKr6LxTU14bzPVX u2dI76I+z0jxvkS5UZEl0uP1wXEyXE8XRP0f25lsLqL2f8XRvp5I3u4/5ocwfc2dPn99 weUCcWHTl3Da2ijwTEIxQ1Go5qHWyZJ204Sj/37m4rF7unjwrPhgYTpBXjWeHUoKVVk9 /hLSCoNFmuwaJIf4zzVgzblY9xJv48sOz+lJmbUbPdWqwshlhwbxbLl+FMT4Rf8u165R UZ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=dr2eaYvk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a17090aa68400b0023d0131c21asi2342590pjq.66.2023.03.15.12.55.43; Wed, 15 Mar 2023 12:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=dr2eaYvk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjCOTjn (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232883AbjCOTj0 (ORCPT ); Wed, 15 Mar 2023 15:39:26 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29CB64B3E for ; Wed, 15 Mar 2023 12:39:17 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id g9so17363033qvt.8 for ; Wed, 15 Mar 2023 12:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=axV3b7MOxr7kX8qyghaLBRtLrKYOLo8UOyKWzHAv10o=; b=dr2eaYvkOgPd0aEVBn12iOIdTI+nYzWGoFDs+yIe7nf4LdBfmjyuUqyx6BARTlwxjL NjDOPUlwUYo5ofycWAMbOEXXiQYNiANpL8ohKlu1F2bwYXyd7rtEx2eMzpUz4iDhO306 OarLgjafO56s3QGKCDqYYd+/feEM7oaN7Ti+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=axV3b7MOxr7kX8qyghaLBRtLrKYOLo8UOyKWzHAv10o=; b=7h2LZjWAaBiRVEItuBCPsh74JzmbmOmpa3yxkFB3f45yoPpAdCXonBobGak6QhEp9S MuLupga9RUHBNtimhk+ANeBlHcHhjv6ZQ2wDgnswsme7dzahvHiLbqAE9D3IpEgXVVFU HaYM2emQAmRrceK6vaZOqyqc77Ka+/4ZhP+hzyBZMiIwndgXEHIQUYFIupkm7wxx10jv M37TZbz9kEJ+qZ3ZRV6DUX1ODueQKHHd/xOTex4eULRvcwIL+VRi5wFSa5zurYBM4vn8 gL/BGBafrwreU/79FSgbqdpbkeYNl0ddziLAiF3QSvQzjHmNgNqo3dxS4xxABITfyjqo NHtA== X-Gm-Message-State: AO0yUKXLcOTgoLH1TrCcu1GRvauASdpNLRJVuIvE8e5t80kGmoBfpiWm gPsagRaHP16xBKlKc6d01qTIkSVdGFri0+UDVek= X-Received: by 2002:a05:6214:23c9:b0:56f:c138:2844 with SMTP id hr9-20020a05621423c900b0056fc1382844mr26775671qvb.37.1678909156672; Wed, 15 Mar 2023 12:39:16 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:16 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Jonathan Corbet Cc: "Uladzislau Rezki (Sony)" , rcu@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 5/6] doc: Update whatisRCU.rst Date: Wed, 15 Mar 2023 19:38:50 +0000 Message-Id: <20230315193851.8598-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230315193851.8598-1-joel@joelfernandes.org> References: <20230315193851.8598-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760464897104407459?= X-GMAIL-MSGID: =?utf-8?q?1760464897104407459?= From: "Uladzislau Rezki (Sony)" The kfree_rcu() macro is deprecated. Rename it to its new kfree_rcu_mightsleep() name in this documentation. Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/whatisRCU.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst index 2c5563a91998..8eddef28d3a1 100644 --- a/Documentation/RCU/whatisRCU.rst +++ b/Documentation/RCU/whatisRCU.rst @@ -597,10 +597,10 @@ to avoid having to write your own callback:: If the occasional sleep is permitted, the single-argument form may be used, omitting the rcu_head structure from struct foo. - kfree_rcu(old_fp); + kfree_rcu_mightsleep(old_fp); -This variant of kfree_rcu() almost never blocks, but might do so by -invoking synchronize_rcu() in response to memory-allocation failure. +This variant almost never blocks, but might do so by invoking +synchronize_rcu() in response to memory-allocation failure. Again, see checklist.rst for additional rules governing the use of RCU. From patchwork Wed Mar 15 19:38:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 70410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp87316wrt; Wed, 15 Mar 2023 12:46:00 -0700 (PDT) X-Google-Smtp-Source: AK7set97lNlE/syh8oItvfloBRNHlEgox8MjV9JOvy4Ja17tZM/FIiA3debsbyxW34Hl0g8nGfSO X-Received: by 2002:a05:6a20:748a:b0:d0:61ff:8530 with SMTP id p10-20020a056a20748a00b000d061ff8530mr1146143pzd.16.1678909560147; Wed, 15 Mar 2023 12:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678909560; cv=none; d=google.com; s=arc-20160816; b=kW3MSVYRG9optA+QzxY5OTQDe7yhLTObAinEAYZ6t5CZbZBAE49UPDcpfxkomf4f/F vbUD0Rv3XwUzdSzSr0dAWml13N5y6/tROpTdSXp3Z3PkHzjq6XlftpivIerM2fbFwDr/ tbpAWNQ863/yDmOz87WqpkHN78VTuDVHihuSLIBsd4SRVLp+XNw/BYLA5XJmiX7m635X ZHaWAbWu5B90aFLNslqFbYX8+scjQzfBUzfAffELOVzowL6+lgx5OvnL7uL/AvwY0Nnw C4YSGvqvRl6QfzUeYypm8djvNIoM4XETqrxmqQzTwJENVFE4P45XNSgnzFcUIo/LlR0W 5Umg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H58NOkpBsborYqDlb6apVPOFULtTVVJdIxtX+vdpwc4=; b=LlGHhjEo/P4reZEnhaZauFRnrxy8OvfE0BvB1BoiWEJICsGgM3Vzjs2Jt+yznc65hu n26dSt8V+kO7u6VC48N2nTC3bOZMHqDZgBJEMc0rwC0aAmGvSkEk8NScv+Bwr8YxwHcO EpQP0qHl8ldMdq+EHd0xNuuNpIWS/ROEoSQzNoJih2BRB7Nuq/SoEr2BHjYcej8kAp0J 4uuUU1wWDQ+ui01sp8/2RToQlWFQmg/ENj7oz37qcaYec2o7VkmDWx+/ZrhGRv72OPHQ Qt/6A2JutWAX4l5k1dEL91MneOz2QUZVT1pca25M8Od7W6h7NJMVRZfjt4qunZwpy+H1 Bwrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=C093a986; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v12-20020a63d54c000000b0050726756ee8si5947669pgi.93.2023.03.15.12.45.47; Wed, 15 Mar 2023 12:46:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=C093a986; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbjCOTj4 (ORCPT + 99 others); Wed, 15 Mar 2023 15:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232897AbjCOTj0 (ORCPT ); Wed, 15 Mar 2023 15:39:26 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE18167711 for ; Wed, 15 Mar 2023 12:39:18 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id d7so17419077qtr.12 for ; Wed, 15 Mar 2023 12:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1678909158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H58NOkpBsborYqDlb6apVPOFULtTVVJdIxtX+vdpwc4=; b=C093a986XM+BY5phSly7wrGZCcmMxTiTlUfXZxpE7QnM3ZVj5e2y6nnNsgpnj1q4g3 b6kqPR4fnmeuu41UvzmMuQxZPdQQZyQ53vE4qe5XrF40jJi2gYTkZ1sgrCn/kXrFPMt0 uDqqMdAuP1MgwDf5FFqNt6sQOBCop356zuIeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678909158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H58NOkpBsborYqDlb6apVPOFULtTVVJdIxtX+vdpwc4=; b=o9KTTEdd/hWVp5j5JNEixNn6GJQ+VEQN8DYGHRR4P8Wiozmbzn2oYN1uvoqd+A0o4+ IeEyssB3pg/o6uvH9W/TMJ2SPvZ84Pr7AOrYZUd2YZGJvpTYmoSs3gX1yfdywyNUAoVw n/O7KBl0nBLY6TOpAbF6+dO9WbnK0CoS092D4ix7mn4g9v3QqWfUF83LehTPUAjZx1GO cjfFJayrIFGxhlqYMNW0ikbl81WvbqOisrnmgpe+EsDLE5YEHmciF9dVVhBwp1x7XXzr Q6T5fr0gWkQUBAqhOoLloOfpSRQYAraDpOvLMnvOUHZP9FQPCEwDBl0xvA41uJK776sh D9Uw== X-Gm-Message-State: AO0yUKX1YUiOLwfhKsIHvU/oKgq+1iduuEp5lzY47bIdsXLfI2Cty8VS IoexAwIlHv9bNkCHOVXnqXN6bqmIM4tBVQpLEFM= X-Received: by 2002:ac8:5bca:0:b0:3bf:be4b:808c with SMTP id b10-20020ac85bca000000b003bfbe4b808cmr1465528qtb.55.1678909157780; Wed, 15 Mar 2023 12:39:17 -0700 (PDT) Received: from joelboxx.c.googlers.com.com (129.239.188.35.bc.googleusercontent.com. [35.188.239.129]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b00745af48838bsm4347227qko.5.2023.03.15.12.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 12:39:17 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes Cc: rcu@vger.kernel.org Subject: [PATCH 6/6] rcu: Add comment to rcu_do_batch() identifying rcuoc code path Date: Wed, 15 Mar 2023 19:38:51 +0000 Message-Id: <20230315193851.8598-6-joel@joelfernandes.org> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog In-Reply-To: <20230315193851.8598-1-joel@joelfernandes.org> References: <20230315193851.8598-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760464270963570331?= X-GMAIL-MSGID: =?utf-8?q?1760464270963570331?= From: "Paul E. McKenney" This commit adds a comment to help explain why the "else" clause of the in_serving_softirq() "if" statement does not need to enforce a time limit. The reason is that this "else" clause handles rcuoc kthreads that do not block handlers for other softirq vectors. Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 8e880c09ab59..06cc6a6ad819 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2131,6 +2131,8 @@ static void rcu_do_batch(struct rcu_data *rdp) break; } } else { + // In rcuoc context, so no worries about depriving + // other softirq vectors of CPU cycles. local_bh_enable(); lockdep_assert_irqs_enabled(); cond_resched_tasks_rcu_qs();