Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp15263rdb; Wed, 1 Nov 2023 15:17:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkQs0Q0ZUuBpAw7BZkpKOu43oBsBrAOjjyKTb1MQJwS94EYMbEBbmD4V7ccDnutMiUdP4Z X-Received: by 2002:a05:6a21:6d90:b0:163:f945:42da with SMTP id wl16-20020a056a216d9000b00163f94542damr21184706pzb.48.1698877034049; Wed, 01 Nov 2023 15:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698877034; cv=none; d=google.com; s=arc-20160816; b=xI7+T6I9qxi2bNwF0brQw8J5FkYldnGfAASpH2cSacW1Wxwji4Se27GQrM88rB0ksL c0VXcW/a7r2bv9dQIWbIV3i6rbZ+Vku3oWabZx7D/Ye8B7mNMzsS9xgWXdKd2jWZtnSH mUwcyAsWVglBARhqSSyCmCIpaLVgrxpR22Rtx0BcJkAshJrswvnLvRXYJggCdXsUhw0x TS6vErxwoachZsElHqbLosyRj70d14qvzeNb6uS3ODXQDbV+7M5F/WfdwPrhhJ0ptqxr TIcJYoBm7IggyME6nYHNymXiY7PmRIjW17lqojdN0lRY5qLPxtJDqlm2q/iDqblD+xY2 jTXg== 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=mk6bwPrzaDg2FJugacWSMukVdQ2Mx/nmU75IHB2Mc8w=; fh=rLah2dbOxp23DZUj6pQYOcgsGIAYDbLwLDNc6sfnH8c=; b=kpcSr19V+gnhO833eZ42/B6vym6q4pH2feQfZx7WMhLRD+LADmm+kia6Jc43yVQHq/ ZcDAF4GqPRvriOlCJFjEB17EvJTrYvT9hKFEie5RVUsHTXGIgAqoF429HEZ126pMXKzo BNrnZscp0qphcx7Zb3b7lLUgxl2yNZn7wdJtd98DqtymGlqTvv30aLADN6gpjOWsMPDd qJ5lVPIQXiPxmpBRHcpqw6uadExoeKHoUv5e+rZ3Nc1OCNIMBsUOB64FL7KPRqZ+Vgxg iw6450yAvHFHp8cDerXiI7C+4ReOjDRxK0cdhnImipz8eSz4CHQ16L//EG86joWO79Rs vNSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SEriGOSH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b17-20020aa78ed1000000b006b4319c78efsi2374184pfr.389.2023.11.01.15.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 15:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SEriGOSH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 9E9C98080EF2; Wed, 1 Nov 2023 15:17:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234974AbjKAWRA (ORCPT + 99 others); Wed, 1 Nov 2023 18:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233861AbjKAWQ7 (ORCPT ); Wed, 1 Nov 2023 18:16:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F5610F for ; Wed, 1 Nov 2023 15:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698876971; 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=mk6bwPrzaDg2FJugacWSMukVdQ2Mx/nmU75IHB2Mc8w=; b=SEriGOSHkKkk89XKS7gFnOvhWLaxkFyjLCg0mbR0wzM1/+pCOKPWmoq/Bm1Hbqwx+zc3a/ VAe8gLM5WHbM8nJ5wsjmvYXdblR335lj/7a8jMDO18iz/1P6UteywspfXh/pZqaFLX5sTo evYGlj5GTJzdpvlKC6Tgb+vME33vHas= 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-624-XZuOk2zqNd63bs2DQKNelA-1; Wed, 01 Nov 2023 18:16:08 -0400 X-MC-Unique: XZuOk2zqNd63bs2DQKNelA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 A1C4F185A781; Wed, 1 Nov 2023 22:16:07 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.94]) by smtp.corp.redhat.com (Postfix) with SMTP id 142F12026D4C; Wed, 1 Nov 2023 22:16:04 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 1 Nov 2023 23:15:06 +0100 (CET) Date: Wed, 1 Nov 2023 23:15:02 +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: <20231101221502.GE32034@redhat.com> References: <20231101202302.GB32034@redhat.com> <20231027095842.GA30868@redhat.com> <1952182.1698853516@warthog.procyon.org.uk> <1959032.1698873608@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1959032.1698873608@warthog.procyon.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 01 Nov 2023 15:17:11 -0700 (PDT) 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 am going to return to this later. Oleg.