Skip to contentSkip to conversation

f2fs: give time to flush dirty pages for checkpoint

PATCH New Jaegeuk Kim 1 participant 3 messages Apr 12, 2017

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/3 f2fs: give time to flush dirty pages for checkpoint

If all the threads are waiting for checkpoint, we have no chance to flush required dirty pages.

---
 fs/f2fs/checkpoint.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/checkpoint.c +3 -0
index 9db92990f193..800be94f8cb3 100644
@@ -980,6 +980,7 @@ static int block_operations(struct f2fs_sb_info *sbi)
 		err = sync_dirty_inodes(sbi, DIR_INODE);
 		if (err)
 			goto out;
+		cond_resched();
 		goto retry_flush_dents;
 	}
 
@@ -995,6 +996,7 @@ static int block_operations(struct f2fs_sb_info *sbi)
 		err = f2fs_sync_inode_meta(sbi);
 		if (err)
 			goto out;
+		cond_resched();
 		goto retry_flush_dents;
 	}
 
@@ -1009,6 +1011,7 @@ static int block_operations(struct f2fs_sb_info *sbi)
 			f2fs_unlock_all(sbi);
 			goto out;
 		}
+		cond_resched();
 		goto retry_flush_nodes;
 	}
 
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH 2/3 f2fs: allocate hot_data for atomic writes

We'd better allocate atomic writes to hot_data zone.

---
 fs/f2fs/file.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/file.c +1 -0
index 4731eb587e06..0ac833dd2634 100644
@@ -1531,6 +1531,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
 		goto out;
 
 	set_inode_flag(inode, FI_ATOMIC_FILE);
+	set_inode_flag(inode, FI_HOT_DATA);
 	f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
 
 	if (!get_dirty_pages(inode))
Signature · 6 lines
2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
author maintainer
#2 lore raw

PATCH 3/3 f2fs: fix not to set fsync/dentry mark

In reply to Jaegeuk Kim

Otherwise, we can see stale fsync/dentry mark given by previous calls, resulting in giving up roll-forward recovery due to wrong dentry mark.

---
 fs/f2fs/node.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/node.c +3 -0
index 9422dd252813..ad54e907b97b 100644
@@ -1458,6 +1458,9 @@ int fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
 			f2fs_wait_on_page_writeback(page, NODE, true);
 			BUG_ON(PageWriteback(page));
 
+			set_fsync_mark(page, 0);
+			set_dentry_mark(page, 0);
+
 			if (!atomic || page == last_page) {
 				set_fsync_mark(page, 1);
 				if (IS_INODE(page)) {
Signature · 1 line
2.11.0