From: Eric Dumazet Date: Thu, 28 Jul 2011 04:11:47 +0000 (+0200) Subject: vfs: conditionally call inode_wb_list_del() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b12362bdb61a230a67daa77bcd2a11e59b2802e1;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Al Viro --- diff --git a/fs/inode.c b/fs/inode.c index d0c72ff6b30e..9dab13ae6ef7 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -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) {