Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3337375rdb; Thu, 16 Nov 2023 07:03:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfypCsN2n2bcM0uUN22nQMuQXQQP20+OpELGI7lCtxR8ywp+YaseVamWI8p9Li3bRizUFn X-Received: by 2002:a17:90b:3e84:b0:280:94e8:99f4 with SMTP id rj4-20020a17090b3e8400b0028094e899f4mr16663316pjb.46.1700147005917; Thu, 16 Nov 2023 07:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700147005; cv=none; d=google.com; s=arc-20160816; b=AtGroDk8rxR7npNQgf0OlK9eVca2wNzbHVsvbKyBGhzlDR2JHSgNkKATgpNKwfbTM2 6zX/oxaH1pGdUfYJpSRN4MS6hGZ9B7z6MN62GXWSXGaEuJs+rxnwSnbU6wmOpZQRzYOB qRqkJ2KoUOSQ47PZH50w1AEfbJIIS2gu/R3Le2e35GE5kGMEJD2oBpGZ9Jts0kbbPcg6 8tRHxjuzBDZGP+r52nRi/h+XUCu5CeWS4LqOY7w8BxSp4FDQ8Po8JcTBunO/B1JLrSSm bvdw2Oa7uwQB0uCMyI/v/h3qlHiZAu1c9Kw+n/LSb+2q/hpVpq/EdXx1i57F6JNG6j3o 9LgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=5BIrNHr+7LsQlEelkvUxuM/ROYOUGHN6QZSqtuj1rRc=; fh=rTkb05KnUKNdCQbXmvD8YjWSS8HeswaSxV+3+MQ/Me0=; b=PFfypKIDXZxDFukpGpuww22LYOHi+BLVM3Mr+4sBTLEt59gsC9T48o2Eq9+6fQYGfg 3GyIYL7sxkPX6J7NNgHs4gIl0XBr+38WRdtzI2VpVRRGW53/w0J8h8NoVCB4sRfpP+0g p1cjB894vs5ztdNe9k5Es7eM13jLUGkmVpfNLw80GpEL0jv8qz2pxxO7ETnI5ip/ame3 BBnOexK9u3L8XWptbJuR7RsjLfcXklKJTwvtLf4EFEuXlTTn9kerwNyJWXb41v0KUTTM CZl8vXb58xqCg3XvbizIo1qJHEwvigcCxWyCbvu3VvkismjEThGYdrf8vH6Mo2TahAdl XY5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WFFIoiVb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id z23-20020a17090a541700b0028074aabfecsi2083286pjh.128.2023.11.16.07.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:03:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WFFIoiVb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 419D88023D5D; Thu, 16 Nov 2023 07:03:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345377AbjKPPDN (ORCPT + 99 others); Thu, 16 Nov 2023 10:03:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345349AbjKPPDL (ORCPT ); Thu, 16 Nov 2023 10:03:11 -0500 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 D4C1E93 for ; Thu, 16 Nov 2023 07:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700146987; 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=5BIrNHr+7LsQlEelkvUxuM/ROYOUGHN6QZSqtuj1rRc=; b=WFFIoiVbYrfjyZ/7PNb08cPbp/dKfJfw2MVDcnU9977I+C47yCFVenAb/EZ23Gr3PnIwrY xxEtonvtrUMAevR6DYXatzupIwriQ5wdfVsfDkkA0DLo6jORb1ZGAYT77CEh1Er+lAoL2A Axfp7jeNL8NPJcLHxFY4ROq3sO0dlpI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-507-Qi3ZhHIZNuC-syAMsHYkgw-1; Thu, 16 Nov 2023 10:03:02 -0500 X-MC-Unique: Qi3ZhHIZNuC-syAMsHYkgw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 9304F1C07556; Thu, 16 Nov 2023 15:02:12 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CCB8C15881; Thu, 16 Nov 2023 15:02:10 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20231116141951.GE18748@redhat.com> References: <20231116141951.GE18748@redhat.com> <20231116131849.GA27763@redhat.com> <20231027095842.GA30868@redhat.com> <104932.1700142106@warthog.procyon.org.uk> To: Oleg Nesterov Cc: dhowells@redhat.com, Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Al Viro , 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() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <112161.1700146930.1@warthog.procyon.org.uk> Date: Thu, 16 Nov 2023 15:02:10 +0000 Message-ID: <112162.1700146930@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-1.0 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 16 Nov 2023 07:03:18 -0800 (PST) Oleg Nesterov wrote: > > > - the usage of read_seqbegin_or_lock/need_seqretry in > > > this code makes no sense because read_seqlock_excl() > > > is not possible > > > > Not exactly. I think it should take a lock on the second pass. > > OK, then how about the patch below? That seems to work. David