* [f2fs-dev] [PATCH v2] f2fs: optimize f2fs DIO overwrites
@ 2025-03-17 13:36 ` Yohan Joung
0 siblings, 0 replies; 6+ messages in thread
From: Yohan Joung @ 2025-03-17 13:36 UTC (permalink / raw)
To: jaegeuk, chao, daeho43; +Cc: linux-kernel, linux-f2fs-devel
this is unnecessary when we know we are overwriting already allocated
blocks and the overhead of starting a transaction can be significant
especially for multithreaded workloads doing small writes.
Signed-off-by: Yohan Joung <yohan.joung@sk.com>
---
fs/f2fs/data.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index d872f785a996..d99ec9370b1d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -4181,7 +4181,13 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
map.m_next_pgofs = &next_pgofs;
map.m_seg_type = f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
inode->i_write_hint);
- if (flags & IOMAP_WRITE)
+
+ /*
+ * If the blocks being overwritten are already allocated,
+ * f2fs_map_lock and f2fs_balance_fs are not necessary.
+ */
+ if ((flags & IOMAP_WRITE) &&
+ !f2fs_overwrite_io(inode, offset, length))
map.m_may_create = true;
err = f2fs_map_blocks(inode, &map, F2FS_GET_BLOCK_DIO);
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2] f2fs: optimize f2fs DIO overwrites
@ 2025-03-17 13:36 ` Yohan Joung
0 siblings, 0 replies; 6+ messages in thread
From: Yohan Joung @ 2025-03-17 13:36 UTC (permalink / raw)
To: jaegeuk, chao, daeho43; +Cc: linux-f2fs-devel, linux-kernel, Yohan Joung
this is unnecessary when we know we are overwriting already allocated
blocks and the overhead of starting a transaction can be significant
especially for multithreaded workloads doing small writes.
Signed-off-by: Yohan Joung <yohan.joung@sk.com>
---
fs/f2fs/data.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index d872f785a996..d99ec9370b1d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -4181,7 +4181,13 @@ static int f2fs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
map.m_next_pgofs = &next_pgofs;
map.m_seg_type = f2fs_rw_hint_to_seg_type(F2FS_I_SB(inode),
inode->i_write_hint);
- if (flags & IOMAP_WRITE)
+
+ /*
+ * If the blocks being overwritten are already allocated,
+ * f2fs_map_lock and f2fs_balance_fs are not necessary.
+ */
+ if ((flags & IOMAP_WRITE) &&
+ !f2fs_overwrite_io(inode, offset, length))
map.m_may_create = true;
err = f2fs_map_blocks(inode, &map, F2FS_GET_BLOCK_DIO);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs: optimize f2fs DIO overwrites
2025-03-17 13:36 ` Yohan Joung
@ 2025-03-18 1:18 ` Chao Yu
-1 siblings, 0 replies; 6+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-03-18 1:18 UTC (permalink / raw)
To: Yohan Joung, jaegeuk, daeho43; +Cc: linux-kernel, linux-f2fs-devel
On 3/17/25 21:36, Yohan Joung wrote:
> this is unnecessary when we know we are overwriting already allocated
> blocks and the overhead of starting a transaction can be significant
> especially for multithreaded workloads doing small writes.
>
> Signed-off-by: Yohan Joung <yohan.joung@sk.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs: optimize f2fs DIO overwrites
2025-03-17 13:36 ` Yohan Joung
@ 2025-03-18 1:30 ` patchwork-bot+f2fs
-1 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2025-03-18 1:30 UTC (permalink / raw)
To: Yohan Joung; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Mon, 17 Mar 2025 22:36:11 +0900 you wrote:
> this is unnecessary when we know we are overwriting already allocated
> blocks and the overhead of starting a transaction can be significant
> especially for multithreaded workloads doing small writes.
>
> Signed-off-by: Yohan Joung <yohan.joung@sk.com>
> ---
> fs/f2fs/data.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Here is the summary with links:
- [f2fs-dev,v2] f2fs: optimize f2fs DIO overwrites
https://git.kernel.org/jaegeuk/f2fs/c/351bc761338d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [f2fs-dev] [PATCH v2] f2fs: optimize f2fs DIO overwrites
@ 2025-03-18 1:30 ` patchwork-bot+f2fs
0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+f2fs @ 2025-03-18 1:30 UTC (permalink / raw)
To: Yohan Joung; +Cc: jaegeuk, chao, daeho43, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Mon, 17 Mar 2025 22:36:11 +0900 you wrote:
> this is unnecessary when we know we are overwriting already allocated
> blocks and the overhead of starting a transaction can be significant
> especially for multithreaded workloads doing small writes.
>
> Signed-off-by: Yohan Joung <yohan.joung@sk.com>
> ---
> fs/f2fs/data.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Here is the summary with links:
- [f2fs-dev,v2] f2fs: optimize f2fs DIO overwrites
https://git.kernel.org/jaegeuk/f2fs/c/351bc761338d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-18 1:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 13:36 [f2fs-dev] [PATCH v2] f2fs: optimize f2fs DIO overwrites Yohan Joung
2025-03-17 13:36 ` Yohan Joung
2025-03-18 1:18 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-03-18 1:18 ` Chao Yu
2025-03-18 1:30 ` [f2fs-dev] " patchwork-bot+f2fs--- via Linux-f2fs-devel
2025-03-18 1:30 ` patchwork-bot+f2fs
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.