]> Git Repo - linux.git/commitdiff
vfs: conditionally call inode_wb_list_del()
authorEric Dumazet <[email protected]>
Thu, 28 Jul 2011 04:11:47 +0000 (06:11 +0200)
committerAl Viro <[email protected]>
Mon, 1 Aug 2011 05:41:17 +0000 (01:41 -0400)
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 <[email protected]>
Signed-off-by: Al Viro <[email protected]>
fs/inode.c

index d0c72ff6b30e6d259c80d4cd28197441f141fe43..9dab13ae6ef7e31b7e0c5e8ce33ed73348be47c8 100644 (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) {
This page took 0.058569 seconds and 4 git commands to generate.