From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 08/12] superblock: introduce per-sb cache shrinker infrastructure Date: Sat, 4 Jun 2011 15:19:40 +0100 Message-ID: <20110604141940.GW11521@ZenIV.linux.org.uk> References: <1306998067-27659-1-git-send-email-david@fromorbit.com> <1306998067-27659-9-git-send-email-david@fromorbit.com> <20110604004231.GV11521@ZenIV.linux.org.uk> <20110604015212.GD561@dastard> <20110604140848.GA20404@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Dave Chinner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, xfs@oss.sgi.com To: Christoph Hellwig Return-path: Content-Disposition: inline In-Reply-To: <20110604140848.GA20404@infradead.org> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Jun 04, 2011 at 10:08:48AM -0400, Christoph Hellwig wrote: > On Sat, Jun 04, 2011 at 11:52:12AM +1000, Dave Chinner wrote: > > I wanted to put it early on in the unmount path so that the shrinker > > was guaranteed to be gone before evict_inodes() was called. That > > would mean that it is obviously safe to remove the iprune_sem > > serialisation in that function. > > The iprune_sem removal is fine as soon as you have a per-sb shrinker > for the inodes which keeps an active reference on the superblock until > all the inodes are evicted. I really don't like that. Stuff keeping active refs, worse yet doing that asynchronously... Shrinkers should *not* do that. Just grab a passive ref (i.e. bump s_count), try grab s_umount (shared) and if that thing still has ->s_root while we hold s_umount, go ahead. Unregister either at the end of generic_shutdown_super() or from deactivate_locked_super(), between the calls of ->kill_sb() and put_filesystem(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org