From: Eric Dumazet Date: Thu, 28 Jul 2011 04:55:13 +0000 (+0200) Subject: vfs: avoid call to inode_lru_list_del() if possible X-Git-Tag: firefly_0821_release~3680^2~4783^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c4ae0c65455c1bb30d1b71c6dd9a1a62aadde8ef;p=firefly-linux-kernel-4.4.55.git vfs: avoid call to inode_lru_list_del() if possible inode_lru_list_del() is expensive because of per superblock lru locking, while some inodes are not in lru list. Adding a check in iput_final() can speedup pipe/sockets workloads on SMP. Signed-off-by: Eric Dumazet Signed-off-by: Al Viro --- diff --git a/fs/inode.c b/fs/inode.c index e445be2a18f9..5aab80dc008c 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1330,7 +1330,8 @@ static void iput_final(struct inode *inode) } inode->i_state |= I_FREEING; - inode_lru_list_del(inode); + if (!list_empty(&inode->i_lru)) + inode_lru_list_del(inode); spin_unlock(&inode->i_lock); evict(inode);