From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH, RFC] prune back iprune_sem Date: Tue, 15 Feb 2011 15:53:52 +0100 Message-ID: <20110215145352.GA9199@lst.de> References: <20101102184536.GA22941@lst.de> <20110215102916.GA959@lst.de> <20110215144905.GF17313@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , viro@ZenIV.linux.org.uk, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from verein.lst.de ([213.95.11.210]:47965 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102Ab1BOOy2 (ORCPT ); Tue, 15 Feb 2011 09:54:28 -0500 Content-Disposition: inline In-Reply-To: <20110215144905.GF17313@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Feb 15, 2011 at 03:49:05PM +0100, Jan Kara wrote: > inodes, that are just being freed by prune_icache(). Thus we can trigger > WARN_ON() in evict_inodes(): > if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) { > WARN_ON(1); > continue; > } That WARN_ON didn't exist when I submitted the patch three month ago, but yes, it should be removed now. > Otherwise, the change looks safe to me. BTW, the iprune_sem is now used > only so that evict_inodes() can wait for prune_icache() to finish so maybe > we could have something simpler for that? I can't think of anything simple. The proper way to do it would be to make the inode lru per-sb just like the dentry lru list. That way we always hold a reference to the superblock while pruning inodes form the LRU and all associated issues go away. Dave had a patch for this as part of implementing a for_each_sb { prune dcache; prune icache; prune fs-specific cache; } algorithm. I still think it's the right way to go, but it fell under the table and I really need a way to fix the lockdep warning / rare deadlock the current scheme causes for XFS.