Skip to contentSkip to conversation

Move cond_resched() after iput() in sync_sb_inodes()

PATCH New OGAWA Hirofumi 1 participant 1 message Mar 9, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move cond_resched() after iput() in sync_sb_inodes()

Hi,

In here, I think the following order is more cache-friendly. What do you think?

---

 fs/fs-writeback.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fs-writeback.c renamed from fs/fs-writeback.c~iput-before-cond_resched +1 -1
diff -puN fs/fs-writeback.c~iput-before-cond_resched fs/fs-writeback.c
@@ -382,8 +382,8 @@ sync_sb_inodes(struct super_block *sb, s
 			list_move(&inode->i_list, &sb->s_dirty);
 		}
 		spin_unlock(&inode_lock);
-		cond_resched();
 		iput(inode);
+		cond_resched();
 		spin_lock(&inode_lock);
 		if (wbc->nr_to_write <= 0)
 			break;

_