From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Paul E. McKenney" Subject: Re: [PATCH] vfs: Speed up deactivate_super for non-modular filesystems Date: Wed, 9 May 2012 06:59:14 -0700 Message-ID: <20120509135914.GD21152@linux.vnet.ibm.com> References: <1336150643.7502.4.camel@marge.simpson.net> <1336197362.7346.9.camel@marge.simpson.net> <1336198093.7346.11.camel@marge.simpson.net> <1336201977.7346.22.camel@marge.simpson.net> <87r4uv64oj.fsf_-_@xmission.com> <20120507221706.GI22082@ZenIV.linux.org.uk> <20120507235647.GH21152@linux.vnet.ibm.com> <87zk9jzdi5.fsf@xmission.com> Reply-To: paulmck@linux.vnet.ibm.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Eric W. Biederman" , Al Viro , Andrew Morton , Oleg Nesterov , LKML , Pavel Emelyanov , Cyrill Gorcunov , Louis Rilling , Mike Galbraith , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, May 09, 2012 at 05:55:57PM +1000, Nick Piggin wrote: > On 8 May 2012 11:07, Eric W. Biederman wrote: > > "Paul E. McKenney" writes: [ . . . ] > >> Is there anything in there for which synchronous operation is requ= ired? > >> If not, one approach would be to drop the rcu_barrier() calls to a > >> workqueue or something similar. > > > > We need to drain all of the rcu callbacks before we free the slab > > and unload the module. > > > > This actually makes deactivate_locked_super the totally wrong place > > for the rcu_barrier. =A0We want the rcu_barrier in the module exit > > routine where we destroy the inode cache. > > > > What I see as the real need is the filesystem modules need to do: > > =A0 =A0 =A0 =A0rcu_barrier() > > =A0 =A0 =A0 =A0kmem_cache_destroy(cache); > > > > Perhaps we can add some helpers to make it easy. =A0But I think > > I would be happy today with simply moving the rcu_barrier into > > every filesystems module exit path, just before the file system > > module destoryed it's inode cache. >=20 > No, because that's not the only requirement for the rcu_barrier. >=20 > Making it asynchronous is not something I wanted to do, because > then we potentially have a process exiting from kernel space after > releasing last reference on a mount, but the mount does not go > away until "some time" later. Which is crazy. In any case, I am looking into making concurrent calls to rcu_barrier() share each others' work, so if asynchronous turns out to be needed, it will be efficient. Thanx, Paul > However. We are holding vfsmount_lock for read at the point > where we ever actually do anything with an "rcu-referenced" > dentry/inode. I wonder if we could use this to get i_sb pinned. >=20