* [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes
@ 2026-09-06 14:56 Seongjae Jeong
2026-09-09 12:24 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
0 siblings, 2 replies; 3+ messages in thread
From: Seongjae Jeong @ 2026-09-06 14:56 UTC (permalink / raw)
To: jaegeuk, chao; +Cc: linux-kernel, linux-f2fs-devel
The node_change lock serializes block reservation in the PRE_AIO path
against checkpoint preparation, since block reservation can create
dirty node pages and update checkpoint accounting.
However, writes that remain within the inline data area return before
the block reservation path. Thus, they do not call
inc_valid_block_count(), change a node mapping from NULL_ADDR to
NEW_ADDR, or create a dirty node page as a result of block reservation.
They also do not update total_valid_block_count or
alloc_valid_block_count.
The inline path only copies the existing inline data to the data folio,
sets FI_DATA_EXIST, and marks the inode folio for deferred inline data
flushing. FI_DATA_EXIST can dirty inode metadata, but it does not
reserve a block or update the node mapping and checkpoint accounting
that node_change is intended to serialize.
Skip f2fs_map_lock() for writes that fit within MAX_INLINE_DATA. Keep
the existing locking for inline conversion, which can update filesystem
metadata and requires checkpoint serialization.
Signed-off-by: Seongjae Jeong <jsjlee1020@gmail.com>
---
fs/f2fs/data.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 21f396ebe22c..f2fb5ef3cb7a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3690,10 +3690,11 @@ static int prepare_write_begin(struct f2fs_sb_info *sbi,
/* f2fs_lock_op avoids race between write CP and convert_inline_page */
if (f2fs_has_inline_data(inode)) {
- if (pos + len > MAX_INLINE_DATA(inode))
+ if (pos + len > MAX_INLINE_DATA(inode)) {
flag = F2FS_GET_BLOCK_DEFAULT;
- f2fs_map_lock(sbi, &lc, flag);
- locked = true;
+ f2fs_map_lock(sbi, &lc, flag);
+ locked = true;
+ }
} else if ((pos & PAGE_MASK) >= i_size_read(inode)) {
f2fs_map_lock(sbi, &lc, flag);
locked = true;
--
2.53.0
_______________________________________________
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] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes
2026-09-06 14:56 [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes Seongjae Jeong
@ 2026-09-09 12:24 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2026-09-09 12:24 UTC (permalink / raw)
To: Seongjae Jeong, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel
On 9/6/26 22:56, Seongjae Jeong wrote:
> The node_change lock serializes block reservation in the PRE_AIO path
> against checkpoint preparation, since block reservation can create
> dirty node pages and update checkpoint accounting.
>
> However, writes that remain within the inline data area return before
> the block reservation path. Thus, they do not call
> inc_valid_block_count(), change a node mapping from NULL_ADDR to
> NEW_ADDR, or create a dirty node page as a result of block reservation.
> They also do not update total_valid_block_count or
> alloc_valid_block_count.
>
> The inline path only copies the existing inline data to the data folio,
> sets FI_DATA_EXIST, and marks the inode folio for deferred inline data
> flushing. FI_DATA_EXIST can dirty inode metadata, but it does not
> reserve a block or update the node mapping and checkpoint accounting
> that node_change is intended to serialize.
>
> Skip f2fs_map_lock() for writes that fit within MAX_INLINE_DATA. Keep
> the existing locking for inline conversion, which can update filesystem
> metadata and requires checkpoint serialization.
>
> Signed-off-by: Seongjae Jeong <jsjlee1020@gmail.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] 3+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes
2026-09-06 14:56 [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes Seongjae Jeong
2026-09-09 12:24 ` Chao Yu via Linux-f2fs-devel
@ 2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs--- via Linux-f2fs-devel @ 2026-09-14 15:30 UTC (permalink / raw)
To: Seongjae Jeong; +Cc: jaegeuk, linux-kernel, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Sun, 6 Sep 2026 14:56:11 +0000 you wrote:
> The node_change lock serializes block reservation in the PRE_AIO path
> against checkpoint preparation, since block reservation can create
> dirty node pages and update checkpoint accounting.
>
> However, writes that remain within the inline data area return before
> the block reservation path. Thus, they do not call
> inc_valid_block_count(), change a node mapping from NULL_ADDR to
> NEW_ADDR, or create a dirty node page as a result of block reservation.
> They also do not update total_valid_block_count or
> alloc_valid_block_count.
>
> [...]
Here is the summary with links:
- [f2fs-dev] f2fs: skip node_change lock for inline data writes
https://git.kernel.org/jaegeuk/f2fs/c/66eec36c2421
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] 3+ messages in thread
end of thread, other threads:[~2026-09-14 15:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 14:56 [f2fs-dev] [PATCH] f2fs: skip node_change lock for inline data writes Seongjae Jeong
2026-09-09 12:24 ` Chao Yu via Linux-f2fs-devel
2026-09-14 15:30 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
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.