提交 c4ae0c65 编写于 作者: E Eric Dumazet 提交者: Al Viro

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: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 f2ee7abf
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册