Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2087025pxb; Sat, 19 Feb 2022 01:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9JBa7ofdoDf/qTvN2X5Sm+b30Oz/zWE9JdHkVxynCw8mCW8dEWOSySJXqdWAHohNz9oRU X-Received: by 2002:a63:2a45:0:b0:373:1850:d5b with SMTP id q66-20020a632a45000000b0037318500d5bmr9133017pgq.563.1645264047582; Sat, 19 Feb 2022 01:47:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645264047; cv=none; d=google.com; s=arc-20160816; b=Vrpnbf97h63lmbimDDM03x4GSUYx81TcY2guDvwUvXp2WVQC1eZaSebm/LtRyx/XCq Lezk5lbnXispOob4Re9y9TmMHsQxh8tze0V26nk0cJliBZMoCRmaEl8N5pZpefe2vQF+ YrgFqYEYn9qJWLysr1Cd6ioFCEOVNY8O8IKDZkfqkew0TqhSJAltMKk/t+qUpJ03ljQF HlB9H+wzGwDxQtqiwQS1f128QoJ5jhxDulwQcT130LzVEwnj6JDNNmRAThIdGcz2WsdI k+X8s722zKk1d9AcToBB29TKfz9Me1qJKlJexf+9w3sSgzKY5BqUHqEOa9DXzOExug/j uH6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xUNvuNrG7imWiUZvPyted6nVbbjMaKGKVaB32lWP5Wc=; b=JQS+dfYNhHz7ZTVsmUnRS7dAWi0sIZWVfQAxPxjiUvJqt3Szb32lezUTqXoG3AuGzO 5qygCLbcqnZGId/6QWK1iKB2JInY7k0a4tJd9S5lXmUAVxG83ev3QfXxHHzDEhdqZLfM LbXcWrpCqmG1CiuiUafjOmgSE7bQerRtrv1jldnjEuZqH0IK8eS5uplkElAKkZyzlPzF 4XtnQAgZ/h906FI5NfvQFBaq34+xd3HhKcwzuRBfjh2KzTFzh06DtP75rHq1BYNJXpcd 8P7z+W9TneT/HbjlHws4mHnA2qDzjONoDHoRBmWONpK1nflqcjDMOdihXlRR6pn58pcB mv2g== ARC-Authentication-Results: i=1; mx.google.com; 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 h14si5273560pfh.196.2022.02.19.01.47.12; Sat, 19 Feb 2022 01:47:27 -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; 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 S241343AbiBSGII (ORCPT + 99 others); Sat, 19 Feb 2022 01:08:08 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241334AbiBSGIH (ORCPT ); Sat, 19 Feb 2022 01:08:07 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3719859A70; Fri, 18 Feb 2022 22:07:49 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLIuJ-002v4X-W6; Sat, 19 Feb 2022 06:07:48 +0000 Date: Sat, 19 Feb 2022 06:07:47 +0000 From: Al Viro To: Rik van Riel Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-fsdevel@vger.kernel.org, paulmck@kernel.org, gscrivan@redhat.com, Eric Biederman , Chris Mason Subject: Re: [PATCH 1/2] vfs: free vfsmount through rcu work from kern_unmount Message-ID: References: <20220218183114.2867528-1-riel@surriel.com> <20220218183114.2867528-2-riel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Sat, Feb 19, 2022 at 05:58:13AM +0000, Al Viro wrote: > On Sat, Feb 19, 2022 at 05:53:37AM +0000, Al Viro wrote: > > On Fri, Feb 18, 2022 at 01:31:13PM -0500, Rik van Riel wrote: > > > > > struct super_block; > > > struct vfsmount; > > > @@ -73,6 +74,7 @@ struct vfsmount { > > > struct super_block *mnt_sb; /* pointer to superblock */ > > > int mnt_flags; > > > struct user_namespace *mnt_userns; > > > + struct rcu_work free_rwork; > > > } __randomize_layout; > > > > Wait, what? First of all, that has no business being in vfsmount - > > everything that deeply internal belongs in struct mount, not in > > its public part. Moreover, there's already mount->mnt_rcu, so what's > > the point duplicating that? > > Argh... You need rcu_work there... > > OK, so make that a member of the same union mnt_rcu is. In struct mount, > please. And I'm not sure I like the idea of shoving that much into > struct mount, TBH... We might have a plenty of struct mount instances. Very few of them will ever be internal, in the first place. Fewer yet - using kern_unmount_rcu(). And it's not small. If anything, I would consider something like call_rcu(&m->mnt_rcu, callback) with callback adding struct mount to llist and doing schedule_delayed_work() on that. With work consisting of doing mntput on everything in it. I'll get some sleep and put together something along those lines tomorrow morning.