Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5893288rwp; Mon, 17 Jul 2023 11:05:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlEPBo4532IL/w4DW/NIjnEHBn2reD1qotYDHU64YrPNrA7OHh9zYwh1b3+XqdTfA0XV3YVr X-Received: by 2002:a17:906:224e:b0:978:ac42:5ef5 with SMTP id 14-20020a170906224e00b00978ac425ef5mr12709288ejr.65.1689617131239; Mon, 17 Jul 2023 11:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689617131; cv=none; d=google.com; s=arc-20160816; b=Ez9v/64Wn2Fd52hZ/0EE3EQ7wuL0urydP3VCI22Fj1O3oiMkBsKNhf/FnhRiv7BlwE JrTHDOGIyQ6VyLUf46UGWq1T1UW+s4sN2tVZQ6X2ke/e/rBzhOoeXHwEQ9N9v/LpfNs4 tq2ki6cSPbIbgXKdri1mxGQYuOC4MZIPkIR/4dl5DUmnHxWIRWEkMW+7jBi+AR22c5D6 rjK1m7fZQomlrl10GzI6eqMLwZkML54sE/oTwOsmv72l4lnZTmqsjjpu2CYdS3VwrgU/ 174+J5kcvgWmLRutxKi8frFlXgTS0TpNaSbgX9f5U587XO0xY40kcuTByaYXp/lBuUSo Iu4Q== 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=rmsAvq+3CzGKmTBZCkhkb5bZ7snFuh2Qv+7SP3QFges=; fh=Lb56TjNevSGTBIMzcPu79Y+BXL+OVlD7s9uUE6Q7sFQ=; b=ZqwSJl8XAzSzA4iyvk9rMszPOWDODZUBlU0Hy831d6f9fWUwt7gUN2anYTImNRFVeF cONHQDQ+tr0jy+8eHyBbrPxmfZ8XMImVq+BjN4adq27po7KhizOv34ainO3UUr3Xkb24 4oyQxbSkbvQ4dNzsJ0u0/Zk+ejEZ6g1FAVU1kfuDpYIO9p5ZyL5YTArjJVv8k8kfDPVz /rBMiuy5tMUwtti3h4TQPb8QPsFlKofPtB8A7NISLYkAsl373aL0xEm1iBo5Drru6Q4g YZM52igXY9jEZUVby1D+0IBeD4Q07dcsBovZR2HX5DfLgBOp3oRDesW3cIAtkg+CuqD/ ni3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QLwBXp7C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl13-20020a170906e0cd00b00988b6ffa850si5216901ejb.1028.2023.07.17.11.05.06; Mon, 17 Jul 2023 11:05:31 -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=@kernel.org header.s=k20201202 header.b=QLwBXp7C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231248AbjGQSBS (ORCPT + 99 others); Mon, 17 Jul 2023 14:01:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjGQSBO (ORCPT ); Mon, 17 Jul 2023 14:01:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E3A7E6F; Mon, 17 Jul 2023 11:01:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D4C50611CA; Mon, 17 Jul 2023 18:01:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36057C433C9; Mon, 17 Jul 2023 18:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689616872; bh=DbRDqkDR7+Vdxt3VeUxm8chleSMkPylSYd1qg6TB8zI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QLwBXp7Crfow6M3KYd6+plxls68Ur0fT2Nkdatp/DZbVsRouOnFr70xUb3c/klwIu iTQeflgIKapQD0pB+6zg1GG3TLRV8h5ia2A1KLxkgz9z7fUVVWIzqMo8FnUM798Nvs ZbuxcS0w1aWy1kdI3aIswrMKMvVF1iulD9IhgKVm1p4roahptjOYrgcr/hNxlkmQxW Iftf0F3rrGtRO4y93Si7fcv3oxQV+sVNOBAJa3D3ZGc44/d+Ur0e7ii53kST26ZVwH QVaG9t9pLV+fO40Mykmp40T1/IqNDJNghiVkhh2aQYCtO81VFz8hRlPgYE30GdASqa n51GMMaiPGQ1A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id D3F33CE04CD; Mon, 17 Jul 2023 11:01:11 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Alan Huang , "Paul E . McKenney" Subject: [PATCH rcu 2/7] docs/RCU: Add the missing rcu_read_unlock() Date: Mon, 17 Jul 2023 11:01:05 -0700 Message-Id: <20230717180110.1097362-2-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Alan Huang We should exit the RCU read-side critical section before re-entering. Signed-off-by: Alan Huang Signed-off-by: Paul E. McKenney --- Documentation/RCU/rculist_nulls.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/RCU/rculist_nulls.rst b/Documentation/RCU/rculist_nulls.rst index 9a734bf54b76..0612a6387d8e 100644 --- a/Documentation/RCU/rculist_nulls.rst +++ b/Documentation/RCU/rculist_nulls.rst @@ -29,8 +29,10 @@ algorithms: rcu_read_lock() obj = lockless_lookup(key); if (obj) { - if (!try_get_ref(obj)) // might fail for free objects + if (!try_get_ref(obj)) { // might fail for free objects + rcu_read_unlock(); goto begin; + } /* * Because a writer could delete object, and a writer could * reuse these object before the RCU grace period, we -- 2.40.1