Skip to content

Commit

Permalink
vfs: avoid call to inode_lru_list_del() if possible
Browse files Browse the repository at this point in the history
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 <eric.dumazet@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Eric Dumazet authored and Al Viro committed Aug 1, 2011
1 parent f2ee7ab commit c4ae0c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c4ae0c6

Please sign in to comment.