2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 01:04:08 +08:00

vfs: conditionally call inode_wb_list_del()

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>
This commit is contained in:
Eric Dumazet 2011-07-28 06:11:47 +02:00 committed by Al Viro
parent 5a30d8a2b8
commit b12362bdb6

View File

@ -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) {