Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1039659rdh; Fri, 27 Oct 2023 03:03:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESGTtOXvw2e9mPzfrlxg4UMpFMui8QJujPZ7RoGmhIs9nAZi3x47O7u9sTtABCbaTGoORH X-Received: by 2002:a05:6902:14a:b0:da0:51a0:11fe with SMTP id p10-20020a056902014a00b00da051a011femr1869805ybh.42.1698400980258; Fri, 27 Oct 2023 03:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698400980; cv=none; d=google.com; s=arc-20160816; b=K3yKZD24PxUItzET5dUxpYgdC9Tk5Cv2iouLGf4JQ89CyQUExsrQhAtQ4vlkbjzMJS P1roE28j6hZmfXSsq6URCSM2zPJ6KpxFFcIJLOEIdylQNOeylKLVjd7l0NdAqJ0f41/j AQ3CcroICGF6JIFf9bTzWWKl4rEM7aK0uoV4gfKBwNsENVdt8Usy3Wb3pfIikZQE/U+i l++a+9nBB+jtA6WG4ypUX/5f5wGUfRX87+HWDfWCehj4YstEK9qRa7mZKLzXU+7poAl8 WCg8Xua9fzJbzoH8910erhIzy0+scWHjHs+hBYijuHeT9Pd9dHBPjFUszz6AFrfhEBrz iSgw== 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=DTM6upIN3CjY9ys9ca+ckF+e8jrYVgwJYWZX7kJnPgo=; fh=THy7m3uwk7yj9RKwR9/IQMoJWgHHuuAHi4Fgt2a464U=; b=spYpnzq7fIPC7ar2KJqkyK//WHBiY/qXyz5MPW5rc4c3WucuMCVvekktQkRQURgBCZ rMzuwkEgTxBkkUQuLGcIjhN9/wKelk/+JrAfPEREL8LLXqJjhoWUCQ0IvKdUAVwwcFce h5mVJTd+2X6oxsBWJkCbIaMdGe/GIIwjaGGMBF9CP6ZAolQVtdtEROMM4xKy1RiGeIWX ApISdVBueh88GEyWSIPxx//Nj7YU2DbGYBpt3loJoBiFr/r+lzsXyRCr36vzCnU2yH2B SHzshs8XtgurLtgchraY71ls43tapdod+2e3KQVzhdLTw7G22bX9k3XF+gcsto5ZPRbR ILDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="CtQRm/zY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s9-20020a258309000000b00da050425cdbsi1948226ybk.456.2023.10.27.03.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 03:03:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="CtQRm/zY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 22DFC833964C; Fri, 27 Oct 2023 03:02:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231484AbjJ0KCm (ORCPT + 99 others); Fri, 27 Oct 2023 06:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjJ0KCl (ORCPT ); Fri, 27 Oct 2023 06:02:41 -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 C8C5010E for ; Fri, 27 Oct 2023 03:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698400915; 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=DTM6upIN3CjY9ys9ca+ckF+e8jrYVgwJYWZX7kJnPgo=; b=CtQRm/zY7cqXbyCC67qJDryKpUG9kMrlSVm/yhLimGExSLxm5Be1grXAgqxLelYaMAZt4e Z4rgziY/XzHhVNqRhHLK2PJjcUqim0PIR719JEWQqdCvFFYubw7jr0AvDhTIxO9zUlsIfG YGhyJSLgXUUbVKvtHkMPfTHyyyMJa7o= 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-150-gc3zwK0dMquWndlNB0j-Lw-1; Fri, 27 Oct 2023 06:01:52 -0400 X-MC-Unique: gc3zwK0dMquWndlNB0j-Lw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 7E711811E7B; Fri, 27 Oct 2023 10:01:51 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.226.76]) by smtp.corp.redhat.com (Postfix) with SMTP id 3CD8E492BE0; Fri, 27 Oct 2023 10:01:49 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 27 Oct 2023 12:00:50 +0200 (CEST) Date: Fri, 27 Oct 2023 12:00:47 +0200 From: Oleg Nesterov To: David Howells , Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: 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: <20231027100047.GA30884@redhat.com> References: <20231027095842.GA30868@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027095842.GA30868@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 03:02:57 -0700 (PDT) On 10/27, Oleg Nesterov wrote: > > read_seqbegin_or_lock() makes no sense unless you make "seq" odd > after the lockless access failed. See thread_group_cputime() as > an example, note that it does nextseq = 1 for the 2nd round. See also [PATCH 1/2] seqlock: fix the wrong read_seqbegin_or_lock/need_seqretry documentation https://lore.kernel.org/all/20231024120808.GA15382@redhat.com/ > So this code can use read_seqbegin() without changing the current > behaviour. I am trying to remove the misuse of read_seqbegin_or_lock(), then I am going to turn need_seqretry() into static inline int need_seqretry(seqlock_t *lock, int *seq) { int ret = !(*seq & 1) && read_seqretry(lock, *seq); if (ret) *seq = 1; /* make this counter odd */ return ret; } Oleg.