From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH] vfs: fix spinning prevention in prune_icache_sb Date: Fri, 28 Oct 2011 04:08:35 -0400 Message-ID: <20111028080835.GA15719@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:54393 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904Ab1J1IIf (ORCPT ); Fri, 28 Oct 2011 04:08:35 -0400 Received: from hch by bombadil.infradead.org with local (Exim 4.76 #1 (Red Hat Linux)) id 1RJhUR-00045a-64 for linux-fsdevel@vger.kernel.org; Fri, 28 Oct 2011 08:08:35 +0000 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: We need to move the inode to the end of the list to actually make the spinning prevention explained in the comment above it work. With a plain list_move it will simply stay in place as we're always reclaiming from the head of the list. Signed-off-by: Christoph Hellwig diff --git a/fs/inode.c b/fs/inode.c index ca27d4e..4b8492a 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -715,7 +715,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan) * inode to the back of the list so we don't spin on it. */ if (!spin_trylock(&inode->i_lock)) { - list_move(&inode->i_lru, &sb->s_inode_lru); + list_move_tail(&inode->i_lru, &sb->s_inode_lru); continue; }