diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-07-28 00:11:47 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-08-01 01:41:17 -0400 |
commit | b12362bdb61a230a67daa77bcd2a11e59b2802e1 (patch) | |
tree | f85752d085d3618207ef6aa5b7d8a10910201fc5 /fs/inode.c | |
parent | 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818 (diff) |
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>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
454 | BUG_ON(!(inode->i_state & I_FREEING)); | 454 | BUG_ON(!(inode->i_state & I_FREEING)); |
455 | BUG_ON(!list_empty(&inode->i_lru)); | 455 | BUG_ON(!list_empty(&inode->i_lru)); |
456 | 456 | ||
457 | inode_wb_list_del(inode); | 457 | if (!list_empty(&inode->i_wb_list)) |
458 | inode_wb_list_del(inode); | ||
459 | |||
458 | inode_sb_list_del(inode); | 460 | inode_sb_list_del(inode); |
459 | 461 | ||
460 | if (op->evict_inode) { | 462 | if (op->evict_inode) { |