Skip to content

Commit

Permalink
vfs: Revert spurious fix to spinning prevention in prune_icache_sb
Browse files Browse the repository at this point in the history
Revert commit 62a3dde ("vfs: fix spinning prevention in prune_icache_sb").

This commit doesn't look right: since we are looking at the tail of the
list (sb->s_inode_lru.prev) if we want to skip an inode, we should put
it back at the head of the list instead of the tail, otherwise we will
keep spinning on it.

Discovered when investigating why prune_icache_sb came top in perf
reports of a swapping load.

Signed-off-by: Suleiman Souhlal <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Cc: [email protected] # v3.2+
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Suleiman Souhlal authored and torvalds committed Apr 13, 2013
1 parent a49b7e8 commit 5b55d70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
* inode to the back of the list so we don't spin on it.
*/
if (!spin_trylock(&inode->i_lock)) {
list_move_tail(&inode->i_lru, &sb->s_inode_lru);
list_move(&inode->i_lru, &sb->s_inode_lru);
continue;
}

Expand Down

0 comments on commit 5b55d70

Please sign in to comment.