Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp28934rdb; Wed, 1 Nov 2023 15:50:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU0dAeDHrP8JsabE8+AxvuAnfSDeYEz4iTHHLq77tpTTu8Dyaw6p3tu7/eHB+Cl/oudYof X-Received: by 2002:a05:6a21:6d90:b0:163:f945:42da with SMTP id wl16-20020a056a216d9000b00163f94542damr21269952pzb.48.1698879021972; Wed, 01 Nov 2023 15:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698879021; cv=none; d=google.com; s=arc-20160816; b=dXgYsVlYoMSbZR+X2G/EkKM9PdpV+bl5qANhoV5Et6QbETN2mqT2imyQ5hYimdxqzf t/Qtnn66JHAuIVNvEcKoaKnjH4HcW2BIzd9M1gzMuWwfwCi27n19Kg2HqhytmGPtmln0 pFJJNyv+JoYY5BxZO/NtDD+e+rQ8Us23UUdWn4vEdHTAiahfIRZnHTS9cXusxieR7keV 5IBcLKZQTwzKufpRv5/JeNDWA149rglNjJgPYk9HXIU90euFbCKLTkGlreCi5Xy5DWVt 3OoVKVu57M7bg9AfsnjSRzOZZ30XiUiThR5gn0iD0x+RzWCNV/FysssC/7wEa2UyPlMR kjig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Xo32g7hxYpv1bkgyx0yIq0WCh5UQYdpohhdrKedcg28=; fh=qRBz2xQ1ALmKKIihboMjLUFc3T7HajVDEgDj1H01Zbs=; b=OqrHqBl2QlHIX6mDj44q7Ywozw0RRhL3/5EW+/PFmSDA9hyAHxu9cmmucMoukl6KMh qpme57Ae3JQT1A/Vyb49dInlt40017FVudA20QOQLvBLnLK7TrGYqvMqi9SBLzer/r58 7HnBEga0648r0YWiYkG/dYkaoMkOAdCUnKJ7N7ByowhSfFGCIrUCpbU8WNR4s4nBAJhI YP9qhjy+9sIAxZyHVIaD5XGmZai3FpmHUcIzHso3xrkHs0CIA/9oxAoRfka3kN6mX5ue hrpmHvDtLlfx+ANm/NhDli49z5aGvw0kVc80Sq5JeLStoU2XWb7R9dDYY5sYtOtZtAfs W3tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=m3A9bjaI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l73-20020a63914c000000b00578ae22988csi809041pge.327.2023.11.01.15.50.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 15:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=m3A9bjaI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D40B080C256A; Wed, 1 Nov 2023 15:50:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347154AbjKAWtz (ORCPT + 99 others); Wed, 1 Nov 2023 18:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347105AbjKAWtx (ORCPT ); Wed, 1 Nov 2023 18:49:53 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F17D65; Wed, 1 Nov 2023 15:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Xo32g7hxYpv1bkgyx0yIq0WCh5UQYdpohhdrKedcg28=; b=m3A9bjaIsqcd/V0LsFFZuxeyo4 Ua67vaTfb/bEA9+Ytrgn6Ycwb1mxw42ydBwMcKrxJITJXg7zUIf4iJrX5zzkMaQOkTgpdaEWeHkB+ rOzKMkpEOBRxoWPpt2/xKXCFSN//yuKO43xb+CL5psrC0Umrh3Er0gauIQfpOIDaYHsW928LnxXbx DiOUbLcSlTlaYEfW1p2fHI9UrOI9Eur8M5u+HRC6dOknKaC440HUJB7qfZmSUN+B/9FgxTCb3ioLj SvzGq4yQEbIYnOCbiCTvN9bScQtiPmsxDqCF4RqNfq4TppRKbbsj9A75iGAxrA59iLAxORUCpBTXh yWW75LjA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qyK19-009SsA-36; Wed, 01 Nov 2023 22:48:56 +0000 Date: Wed, 1 Nov 2023 22:48:55 +0000 From: Al Viro To: Oleg Nesterov Cc: David Howells , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chuck Lever , linux-afs@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rxrpc_find_service_conn_rcu: use read_seqbegin() rather than read_seqbegin_or_lock() Message-ID: <20231101224855.GJ1957730@ZenIV> References: <20231027095842.GA30868@redhat.com> <1952182.1698853516@warthog.procyon.org.uk> <20231101202302.GB32034@redhat.com> <20231101205238.GI1957730@ZenIV> <20231101215214.GD32034@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231101215214.GD32034@redhat.com> Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 15:50:17 -0700 (PDT) On Wed, Nov 01, 2023 at 10:52:15PM +0100, Oleg Nesterov wrote: > > Why would you want to force that "switch to locked on the second pass" policy > > on every possible caller? > > Because this is what (I think) read_seqbegin_or_lock() is supposed to do. > It should take the lock for writing if the lockless access failed. At least > according to the documentation. Not really - it's literally seqbegin or lock, depending upon what the caller tells it... IMO the mistake in docs is the insistence on using do-while loop for its users. Take a look at d_walk() and try to shoehorn that into your variant. Especially the D_WALK_NORETRY handling...