Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3149546rwb; Wed, 30 Nov 2022 16:18:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf51PUHO8Ppgydc9itBvFiYB1524edyexVhFoVyipo+dhwsGzVcwT7po6UsBbn3pYhMEeOdl X-Received: by 2002:aa7:c94a:0:b0:46b:74e1:872c with SMTP id h10-20020aa7c94a000000b0046b74e1872cmr10014539edt.301.1669853934459; Wed, 30 Nov 2022 16:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669853934; cv=none; d=google.com; s=arc-20160816; b=V3WMYzC4D20LtDmzZVNn+ilyfBrJlTxtj2WQf23j9ahsa8PsijoTmZiBWauAU9dIv0 0i24EwhOKpiPa1jDs8OSdnrsCg5US4zlHNCQQtIG+vHbojLsq2I41HaPIfve3CPqDjX5 rm6CfzEkXP3tErvSeoYeb/1YErE/1YPRZio9d8R0ok80Dp4lpaARYmItwh73sjQQON+6 8A/5SFk/xwW+DxxOGywKIWZhth7k0XT69LGk17tFzvhMujEuc6QxGJvW+aMWGQeCqizd MQXygZAHSzO+DOxUYyqYTnxwLm/EX6OV4tFIR0AcM3+kcvnjZqK82EdKxSSv1maCLR7p 02Bg== 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-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=chCgMEOdPcT2pjDuX1oaF0+9J3jNNFoDJQhqkxGPISA=; b=qfpO0zHmd8vSPdl88Qz+oSbOefaNxZhfcaJqiy4ufzAsADiq539xFmKoh5qZa0V6eN 0FDk45NMqJjuX94eO4rtfBB0KqLXmtjYn1QS01Z9tyrHIwqQoN168u7tMIsrci7ZgaBc nsJN9KUdJ1IOZDeHr4YUbb2T16UUJAFpGUK/FCc15/jDaGXv971ywm9+Jf1piYwzIWzb d3uPo9sWXAGXMyNLCtj2zkm2BP4q1ev1pk21SDiW4dodDuo/E3wArY/7dZGcgQBN/kMQ Hh5VDoBgLX4WTSog6AeUQ357O7ldbulRtcYk/eEasAZ6TIw6dFl9xWZf4tb3G89CQVsI 9mzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h7hHT419; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a056402274c00b0046ac237148asi2845443edd.34.2022.11.30.16.18.34; Wed, 30 Nov 2022 16:18:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h7hHT419; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbiK3XG1 (ORCPT + 83 others); Wed, 30 Nov 2022 18:06:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbiK3XGV (ORCPT ); Wed, 30 Nov 2022 18:06:21 -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 25E11950EC for ; Wed, 30 Nov 2022 15:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669849529; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=chCgMEOdPcT2pjDuX1oaF0+9J3jNNFoDJQhqkxGPISA=; b=h7hHT419mpZn7L0A+INRNceHcGUftkeEvaio0744bs1m0mrnUqi3TjteYJ5L6VvIU5wTl9 IYxO3CZn/jwJ1sPBZmVkp9DItHKTIP2a81w+7mWYFJmeMLWKSwQw1Oaj2bfL3siKmSgizE v1+PasCE9ZP/Jxb5/b0v8DJZjenhsHs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-hLY3PVO3Mv259JTv7fsqyw-1; Wed, 30 Nov 2022 18:05:27 -0500 X-MC-Unique: hLY3PVO3Mv259JTv7fsqyw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E622E2999B58; Wed, 30 Nov 2022 23:05:26 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56C42C15BB4; Wed, 30 Nov 2022 23:05:25 +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: References: <20221130181316.GA1012431@paulmck-ThinkPad-P17-Gen-1> <20221130181325.1012760-14-paulmck@kernel.org> <639433.1669835344@warthog.procyon.org.uk> To: Joel Fernandes Cc: dhowells@redhat.com, "Paul E. McKenney" , rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, netdev@vger.kernel.org Subject: Re: [PATCH rcu 14/16] rxrpc: Use call_rcu_hurry() instead of call_rcu() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <658623.1669849522.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 30 Nov 2022 23:05:22 +0000 Message-ID: <658624.1669849522@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-2.1 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_H2,SPF_HELO_NONE,SPF_NONE 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 Joel Fernandes wrote: > > Note that this conflicts with my patch: > > > > rxrpc: Don't hold a ref for connection workqueue > > https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux= -fs.git/commit/?h=3Drxrpc-next&id=3D450b00011290660127c2d76f5c5ed264126eb2= 29 > > > > which should render it unnecessary. It's a little ahead of yours in t= he > > net-next queue, if that means anything. > = > Could you clarify why it is unnecessary? Rather than tearing down parts of the connection it only logs a trace line= , frees the memory and decrements the counter on the namespace. This it use= d to account that all the pieces of memory allocated in that namespace are gone before the namespace is removed to check for leaks. The RCU cleanup used = to use some other stuff (such as the peer hash) in the rxrpc_net struct but n= o longer will after the patches I submitted. > After your patch, you are still doing a wake up in your call_rcu() callb= ack: > > - ASSERTCMP(refcount_read(&conn->ref), =3D=3D, 0); > + if (atomic_dec_and_test(&rxnet->nr_conns)) > + wake_up_var(&rxnet->nr_conns); > +} > = > Are you saying the code can now tolerate delays? What if the RCU > callback is invoked after arbitrarily long delays making the sleeping > process to wait? True. But that now only holds up the destruction of a net namespace and t= he removal of the rxrpc module. > If you agree, you can convert the call_rcu() to call_rcu_hurry() in > your patch itself. Would you be willing to do that? If not, that's > totally OK and I can send a patch later once yours is in (after > further testing). I can add it to part 4 (see my rxrpc-ringless-5 branch) if it is necessary= . David