From: Jan Kara Subject: Re: [PATCH, RFC] prune back iprune_sem Date: Fri, 5 Nov 2010 00:32:57 +0100 Message-ID: <20101104233257.GB20350@quack.suse.cz> References: <20101102184536.GA22941@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@ZenIV.linux.org.uk, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from cantor.suse.de ([195.135.220.2]:52557 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779Ab0KDXdC (ORCPT ); Thu, 4 Nov 2010 19:33:02 -0400 Content-Disposition: inline In-Reply-To: <20101102184536.GA22941@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 02-11-10 19:45:36, Christoph Hellwig wrote: > iprune_sem is continously giving us lockdep warnings because we do take it in > read mode in the reclaim path, but we're also doing non-NOFS allocations under > it taken in write mode. > > Taking a bit deeper look at it I think it's fixable quite trivially: > > - for invalidate_inodes we do not need iprune_sem at all. We have an active > reference on the superblock, so the filesystem is not going away until it > has finished. > - for evict_inodes we do need it, to make sure prune_icache has done it's > work before we tear down the superblock. But there is no reason to > hold it over the actual reclaim operation - it's enough to cycle through > it after the actual reclaim to make sure we wait for any pending > prune_icache to complete. The patch is OK but it's kind of subtle that evict_inodes() can now skip some inode in the LRU list because prune_icache() is just processing it and so it has elevated i_count. Everything will work out fine because MS_ACTIVE is cleared and thus iput() will destroy the inode and prune_icache() will then just continue with the next inode in the inode_lru list. But as I said above it's subtle... Honza -- Jan Kara SUSE Labs, CR