Skip to content

Commit

Permalink
vfs: conditionally call inode_wb_list_del()
Browse files Browse the repository at this point in the history
Some inodes (pipes, sockets, ...) are not in bdi writeback list.

evict() can avoid calling inode_wb_list_del() and its expensive spinlock
by checking inode i_wb_list being empty or not.

At this point, no other cpu/user can concurrently manipulate this inode
i_wb_list

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 5a30d8a commit b12362b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ static void evict(struct inode *inode)
BUG_ON(!(inode->i_state & I_FREEING));
BUG_ON(!list_empty(&inode->i_lru));

inode_wb_list_del(inode);
if (!list_empty(&inode->i_wb_list))
inode_wb_list_del(inode);

inode_sb_list_del(inode);

if (op->evict_inode) {
Expand Down

0 comments on commit b12362b

Please sign in to comment.