Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3227995rwb; Wed, 30 Nov 2022 17:37:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VU1fNlZOUk2XtA2ellamotSATTGnVx0LZR1yN9sJEgdFGouvY22aJVMpuIeQra2Qr+0vn X-Received: by 2002:a17:906:704:b0:7a1:b555:6f1 with SMTP id y4-20020a170906070400b007a1b55506f1mr56428248ejb.29.1669858675767; Wed, 30 Nov 2022 17:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669858675; cv=none; d=google.com; s=arc-20160816; b=h6B+sqZl6jAdzpSO/y165sY/upzgqmDNrYeNOvI/OIXrq/8rzKAj8U7489j4RdJA/D cyJid0XOumweZa/gJNPzvWYD2FaOkueLxVmG1gIZ9sj3r5uwrKXmBNhMnMdQe+ueQ7oY AynvaMhztDjV07Cao9t0ksetRJgjVaBjQeJRJNb3N9zqZ2XQf0rPd5IyAYThc/38wQfe Xmt5bRk1IyYZQ87fiCwqpCeKHVPQGxKW6u0mn5J+5lRgbwINIE7Q304UByq3ezVnFaDh GeF/SdqjPdyQRhIIhmAs5ynjFOOPVHuPlX/hO0w2/SRpAn1TYpMmKkvjtX6EdmggkX8e AvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HInS/N+iYT5Xyv/3OtkTBTcUMud6010V70HXD5PLrgQ=; b=knBm8a+RsLUv5/707dfOK5eO3A77o9q9GZ4t5eOGD31L+jWI6BVlRCL8mPQ2hhswYV jNA/v5NpA+suczzlL9WHiFDdZtifEKFyjcH2viacjKRbaaJryRGR+tEzvVkjVswxCVLZ Evtsh13+zO1YDjlmBwrn6a3unae9BZWf2lKq/frKiOSKQdQ/sevpEpXIGLaUvUA0X/mr RpxCiU1/mHOwCwD4Zj4e4CdBt0bR5BkUzBLoDE0NllMC5wGsDAITb/1+6n5ezbGR2m87 uj9SdqZlCHOyVkWAMNTWo/37toyivHd3JWpbuyIAelqXHM3IRz0S53yK7v7NGIZIj0jf oeYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=UoueS2pc; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a1709063bc400b007ae417013desi2011649ejf.324.2022.11.30.17.37.36; Wed, 30 Nov 2022 17:37:55 -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=@joelfernandes.org header.s=google header.b=UoueS2pc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbiK3XZk (ORCPT + 83 others); Wed, 30 Nov 2022 18:25:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiK3XZV (ORCPT ); Wed, 30 Nov 2022 18:25:21 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD2DBD893 for ; Wed, 30 Nov 2022 15:17:07 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id db10-20020a0568306b0a00b0066d43e80118so12246220otb.1 for ; Wed, 30 Nov 2022 15:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HInS/N+iYT5Xyv/3OtkTBTcUMud6010V70HXD5PLrgQ=; b=UoueS2pcPxayLxQFXEIfTPHDfYTQ5o6kSdnvOHBEZNmSr0iPL47pGi3D5VEsq4ZZWK NXpkr2RVsUvlg2ueuKu//R0ddEFwoNKwUI8JocQc/BjhTxilDcWD2QOmZbXikPVjP1Gc O0TejO0856WRouyOsoV2XWLCP+fzOhZubAwFU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HInS/N+iYT5Xyv/3OtkTBTcUMud6010V70HXD5PLrgQ=; b=7loSHIu3M901Eamauoo1ZNiZ3VcMmq3tAu+2RHdocAEKPl4ZRvP4PAWIfnufnUI7qs GMPwv0t8qJxjjAWFwWXQd3xJuRxqBPjzLjIL3CC+/9jyRj5quk6UN2xL3a5udbmqHHCk SZHQHz0ffgcLlP0D/AGRn3NVDm7IV+i5IuCy03qkoUhLVXKl56JHQHkUT/BI42QJ0fGJ qtITc5QCCSjHlzRTjiKzssTNWtLK9z9bb85lsNs7Uav5JWFBjmTbglemG1lgMICfzC4P bQ995w+D+6WcfeBrt/6kmx7j400fGzSAq++VVkschLxzdOMKvdZXfUNrA+MdH+vYInIc 8tUA== X-Gm-Message-State: ANoB5pkDOaWGa7X3pDLXxH+nPv1WKpjJmmnVTInl+Xc9MoKtvuf4t8VD 8Pc9Y18vvlCtbWv/cPEOjPLQYjL2AOm5Utgh9ZdiNQ== X-Received: by 2002:a05:6830:1f4a:b0:661:b04c:41d9 with SMTP id u10-20020a0568301f4a00b00661b04c41d9mr22511809oth.92.1669850168015; Wed, 30 Nov 2022 15:16:08 -0800 (PST) MIME-Version: 1.0 References: <20221130181316.GA1012431@paulmck-ThinkPad-P17-Gen-1> <20221130181325.1012760-14-paulmck@kernel.org> <639433.1669835344@warthog.procyon.org.uk> <658624.1669849522@warthog.procyon.org.uk> In-Reply-To: <658624.1669849522@warthog.procyon.org.uk> From: Joel Fernandes Date: Wed, 30 Nov 2022 23:15:51 +0000 Message-ID: Subject: Re: [PATCH rcu 14/16] rxrpc: Use call_rcu_hurry() instead of call_rcu() To: David Howells Cc: "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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Wed, Nov 30, 2022 at 11:05 PM David Howells wrote: > > 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=rxrpc-next&id=450b00011290660127c2d76f5c5ed264126eb229 > > > > > > which should render it unnecessary. It's a little ahead of yours in the > > > 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 used 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 no > longer will after the patches I submitted. > > > After your patch, you are still doing a wake up in your call_rcu() callback: > > > > - ASSERTCMP(refcount_read(&conn->ref), ==, 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 the > 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. Ok sounds good, on module removal the rcu_barrier() will flush out pending callbacks so that should not be an issue. Based on your message, I think we can drop this patch then. Since Paul is already dropping it, no other action is needed. (I just realized my patch was not fixing a test failure, like the other net ones did, but rather we found the issue by static analysis -- i.e. programmatically auditing all callbacks in the kernel doing wake ups). thanks, - Joel