Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp21808rdb; Wed, 1 Nov 2023 15:31:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9oJ861G1bxoGrmPkC6I7XWB+4w25GJElOzENPaI3giaRXPY7KI41nnZXvCX178tnd/ryF X-Received: by 2002:a05:6870:ac87:b0:1d6:3d31:fb4b with SMTP id ns7-20020a056870ac8700b001d63d31fb4bmr22439496oab.24.1698877907381; Wed, 01 Nov 2023 15:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698877907; cv=none; d=google.com; s=arc-20160816; b=epOsJqNUdzpmexcMI04Le19spwYSfe4e9vbUXMQDHM1oYDbSpCwLqxYX/Cqy9L5UuT JS15sPfG7jdp5oVlbp1Ol+ci/v4MdREprorqG7MJ6moJmhNnfeAsJNjtJWz5eD0aQw2r GUv5dpy+/L1VKrMBUJVUTlZI9Cm+HYYacUABsc2ocZPPFXcV7iHAEHfXLiB/cyFQ0zpv x8V3sa/lAlx+q4SoiWaO7g2iC7oF2l1JynP27GQh4FFbVdtGcw0RSXd0SFHq6/XG6fZJ vMExgJGgJX1I0Q1w1stsvc4KiiG0iQ2MEaETa8uNB3CV6Mg8zxRi+/3JQrkn/KPXc454 FJdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5nvpkcJTxTwAjz7TlVL9V1dJMiHLHY5CMgLyZWBf8QQ=; fh=rLah2dbOxp23DZUj6pQYOcgsGIAYDbLwLDNc6sfnH8c=; b=DjUNof5/yZfJbd7cTg3GdytJbw6Zim/XMNtT27XpIsJ8tmSMfi1JZJq7c0mIoTzfpM //OqQ0OGKc6PYNMEwnlBlEUYFCg8XaRr0Kq0zUtbR6ghiTKtd+wmgDQbj4rurY2BVgmI 0n2/enCQNTUM8VVw7UecAoL0uF+7vaM1BoTcLKGAFEXKG7IF097NgsLGnHzAeYnuOx0u okLYu/6rA+mgapP9RL9WxyEmVEQQrrAUt1nIcNBdfJzVgJKygbx5liNdfb3is3lRHoLi RWOJoOwSWRkbr59yR0xLLSnjvJ41XZlbAG8hsf5fJqhnR/kRnzgme6ett57isK5inQf7 dCLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HzZLOMgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y5-20020a655285000000b0057d7cff25besi776694pgp.829.2023.11.01.15.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 15:31:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HzZLOMgR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7139E819FC51; Wed, 1 Nov 2023 15:31:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345806AbjKAWbn (ORCPT + 99 others); Wed, 1 Nov 2023 18:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbjKAWbm (ORCPT ); Wed, 1 Nov 2023 18:31:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B0C5129 for ; Wed, 1 Nov 2023 15:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698877855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5nvpkcJTxTwAjz7TlVL9V1dJMiHLHY5CMgLyZWBf8QQ=; b=HzZLOMgRaroQ2pkH5zSiZKLP1Gl/m+SsGPQFlP9FvTglla3c63Kuz5sqG8GlseaJ5y7ih6 8FO7O70wMivfFz3TAc2SAgtyfzXuV4DQgWGVYngBrsKwkXlnOjSHiMUu1id1NH6qVOmhs4 CCcfYMItn0ZpegWwqSp5MeO39VBIMMk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-SQ0vVLarOueN27W4youw-Q-1; Wed, 01 Nov 2023 18:30:52 -0400 X-MC-Unique: SQ0vVLarOueN27W4youw-Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 169C880B638; Wed, 1 Nov 2023 22:30:52 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.94]) by smtp.corp.redhat.com (Postfix) with SMTP id 323781121308; Wed, 1 Nov 2023 22:30:48 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 1 Nov 2023 23:29:50 +0100 (CET) Date: Wed, 1 Nov 2023 23:29:46 +0100 From: Oleg Nesterov To: David Howells Cc: Marc Dionne , Alexander Viro , "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: <20231101222946.GF32034@redhat.com> References: <20231101202302.GB32034@redhat.com> <20231027095842.GA30868@redhat.com> <1952182.1698853516@warthog.procyon.org.uk> <1959032.1698873608@warthog.procyon.org.uk> <20231101221502.GE32034@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231101221502.GE32034@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 01 Nov 2023 15:31:46 -0700 (PDT) sorry for noise, but in case I wasn't clear... On 11/01, Oleg Nesterov wrote: > > On 11/01, David Howells wrote: > > > > However, I think just changing all of these to always-lockless isn't > > necessarily the most optimal way. > > Yes, but so far I am trying to change the users which never take the > lock for writing, so this patch doesn't change the current behaviour. > > > I wonder if struct seqlock would make more sense with an rwlock rather than a > > spinlock. As it is, it does an exclusive spinlock for the readpath which is > > kind of overkill. > > Heh. Please see > > [PATCH 4/5] seqlock: introduce read_seqcount_begin_or_lock() and friends > https://lore.kernel.org/all/20230913155005.GA26252@redhat.com/ > I meant, we already have seqcount_rwlock_t, but currently you can't do something like read_seqbegin_or_lock(&seqcount_rwlock_t). > I am going to return to this later. Yes. Oleg.