aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-07-28 00:55:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-08-01 01:41:17 -0400
commitc4ae0c65455c1bb30d1b71c6dd9a1a62aadde8ef (patch)
tree75d45726ff5f09955054a665e368b919faf4c105 /fs/inode.c
parentf2ee7abf4c40c8e6bffced923a7c01ea2d1f6c97 (diff)
vfs: avoid call to inode_lru_list_del() if possible
inode_lru_list_del() is expensive because of per superblock lru locking, while some inodes are not in lru list. Adding a check in iput_final() can speedup pipe/sockets workloads on SMP. 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c
index e445be2a18f9..5aab80dc008c 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1330,7 +1330,8 @@ static void iput_final(struct inode *inode)
1330 } 1330 }
1331 1331
1332 inode->i_state |= I_FREEING; 1332 inode->i_state |= I_FREEING;
1333 inode_lru_list_del(inode); 1333 if (!list_empty(&inode->i_lru))
1334 inode_lru_list_del(inode);
1334 spin_unlock(&inode->i_lock); 1335 spin_unlock(&inode->i_lock);
1335 1336
1336 evict(inode); 1337 evict(inode);