Skip to contentSkip to conversation

f2fs: allocate HOT_DATA for IPU writes

PATCH Applied Jaegeuk Kim 3 participants 9 messages Aug 27, 2025 – Sep 2, 2025 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: allocate HOT_DATA for IPU writes

Let's split IPU writes in hot data area to improve the GC efficiency.

---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
 
 		if (file_is_hot(inode) ||
 				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
 			return CURSEG_HOT_DATA;
 		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
 						inode->i_write_hint);
Signature · 1 line
2.51.0.318.gd7df087d1a-goog
maintainer
#1 lore raw
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

Thanks,

Quoted 20 lines
---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
 
 		if (file_is_hot(inode) ||
 				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
 			return CURSEG_HOT_DATA;
 		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
 						inode->i_write_hint);
author maintainer
#2 lore raw
Quoted 5 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

This deals with IPU in the LFS mode.

Quoted 23 lines

Thanks,

Quoted 20 lines
---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
 
 		if (file_is_hot(inode) ||
 				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
 			return CURSEG_HOT_DATA;
 		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
 						inode->i_write_hint);
maintainer
#3 lore raw
Quoted 8 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

This deals with IPU in the LFS mode.

Okay, so, we missed to add f2fs_lfs_mode() condition, right?

Thanks,

Quoted 24 lines
Quoted 24 lines

Thanks,

Quoted 20 lines
---
  fs/f2fs/segment.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
 
  		if (file_is_hot(inode) ||
  				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
  			return CURSEG_HOT_DATA;
  		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
  						inode->i_write_hint);
author maintainer
#4 lore raw
Quoted 11 lines · Chao Yu
Quoted 8 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

This deals with IPU in the LFS mode.

Okay, so, we missed to add f2fs_lfs_mode() condition, right?

Why do we need that?

Quoted 26 lines

Thanks,

Quoted 23 lines
Quoted 23 lines

Thanks,

Quoted 19 lines
---
  fs/f2fs/segment.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
  		if (file_is_hot(inode) ||
  				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
  			return CURSEG_HOT_DATA;
  		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
  						inode->i_write_hint);
maintainer
#5 lore raw
Quoted 6 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 4 lines · Jaegeuk Kim
Quoted 3 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

This deals with IPU in the LFS mode.

Okay, so, we missed to add f2fs_lfs_mode() condition, right?

Why do we need that?

As you mentioned above, this deals w/ IPU in the LFS mode. Am I missing something?

Thanks,

Quoted 27 lines
Quoted 27 lines

Thanks,

Quoted 23 lines
Quoted 23 lines

Thanks,

Quoted 19 lines
---
   fs/f2fs/segment.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
   		if (file_is_hot(inode) ||
   				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
   			return CURSEG_HOT_DATA;
   		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
   						inode->i_write_hint);
author maintainer
#6 lore raw
Quoted 10 lines · Chao Yu
Quoted 9 lines · Jaegeuk Kim
Quoted 8 lines · Chao Yu
Quoted 7 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

This deals with IPU in the LFS mode.

Okay, so, we missed to add f2fs_lfs_mode() condition, right?

Why do we need that?

As you mentioned above, this deals w/ IPU in the LFS mode. Am I missing something?

The IPU flag indicates the data is hot. In lfs_mode, we missed to allocate it into HOT_DATA. In normal mode, IPU will update the data in place, which doesn't affect anything, while newly create data is also good to store in HOT_DATA as well. So, I think we don't need other condition here.

Quoted 30 lines

Thanks,

Quoted 27 lines
Quoted 27 lines

Thanks,

Quoted 23 lines
Quoted 23 lines

Thanks,

Quoted 19 lines
---
   fs/f2fs/segment.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
   		if (file_is_hot(inode) ||
   				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
   			return CURSEG_HOT_DATA;
   		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
   						inode->i_write_hint);
maintainer Reviewed-by
#7 lore raw
Quoted 17 lines · Jaegeuk Kim
Quoted 16 lines · Chao Yu
Quoted 14 lines · Jaegeuk Kim
Quoted 11 lines · Chao Yu
Quoted 8 lines · Jaegeuk Kim
Quoted 5 lines · Chao Yu
Quoted 1 line · On 8/28/25 05:52, Jaegeuk Kim via Linux-f2fs-devel wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

I didn't get it, IPU may be not friendly for migrating data along w/ write in hot area?

This deals with IPU in the LFS mode.

Okay, so, we missed to add f2fs_lfs_mode() condition, right?

Why do we need that?

Quoted 7 lines
Quoted 2 lines

As you mentioned above, this deals w/ IPU in the LFS mode. Am I missing something?

The IPU flag indicates the data is hot. In lfs_mode, we missed to allocate it into HOT_DATA. In normal mode, IPU will update the data in place, which doesn't affect anything, while newly create data is also good to store in HOT_DATA as well. So, I think we don't need other condition here.

It makes sense, thanks for the explanation.

Thanks,

Quoted 31 lines
Quoted 31 lines

Thanks,

Quoted 27 lines
Quoted 27 lines

Thanks,

Quoted 23 lines
Quoted 23 lines

Thanks,

Quoted 19 lines
---
   fs/f2fs/segment.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/segment.c +2 -1
index e0f6589c6a1c..bb79dad55ac9 100644
@@ -3688,7 +3688,8 @@ static int __get_segment_type_6(struct f2fs_io_info *fio)
   		if (file_is_hot(inode) ||
   				is_inode_flag_set(inode, FI_HOT_DATA) ||
-				f2fs_is_cow_file(inode))
+				f2fs_is_cow_file(inode) ||
+				is_inode_flag_set(inode, FI_NEED_IPU))
   			return CURSEG_HOT_DATA;
   		return f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
   						inode->i_write_hint);
#8 lore raw
In reply to Jaegeuk Kim
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 6 lines · On Wed, 27 Aug 2025 21:52:22 +0000 you wrote:

Let's split IPU writes in hot data area to improve the GC efficiency.

---
 fs/f2fs/segment.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
- [f2fs-dev] f2fs: allocate HOT_DATA for IPU writes

    https://git.kernel.org/jaegeuk/f2fs/c/c872b6279cd2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html