From mboxrd@z Thu Jan 1 00:00:00 1970 From: npiggin@kernel.dk Subject: [patch 30/35] fs: icache lazy LRU avoid LRU locking after IO operation Date: Tue, 19 Oct 2010 14:42:46 +1100 Message-ID: <20101019034658.635338577@kernel.dk> References: <20101019034216.319085068@kernel.dk> To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: Received: from ipmail04.adl6.internode.on.net ([150.101.137.141]:28444 "EHLO ipmail04.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933552Ab0JSD4V (ORCPT ); Mon, 18 Oct 2010 23:56:21 -0400 Content-Disposition: inline; filename=fs-inode-lazy-lru-wb-avoid.patch Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Now that inode LRU and writeback lists and locking are separated, it makes sense to avoid LRU manipulation after completing a writeback, and instead rely on lazy-LRU algorithm to do the work for us. Signed-off-by: Nick Piggin --- fs/fs-writeback.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: linux-2.6/fs/fs-writeback.c =================================================================== --- linux-2.6.orig/fs/fs-writeback.c 2010-10-19 14:19:00.000000000 +1100 +++ linux-2.6/fs/fs-writeback.c 2010-10-19 14:19:18.000000000 +1100 @@ -410,7 +410,11 @@ * The inode is clean */ list_del_init(&inode->i_io); - if (list_empty(&inode->i_lru)) + + /* + * Put it on the LRU if it is unused, otherwise lazy. + */ + if (!inode->i_count && list_empty(&inode->i_lru)) __inode_lru_list_add(inode); } }