All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/563: allow read tolerance for f2fs in scenario 3
@ 2026-05-15  8:26 Jan Prusakowski
  2026-05-20  8:14 ` Chao Yu
  2026-05-20 10:25 ` Zorro Lang
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Prusakowski @ 2026-05-15  8:26 UTC (permalink / raw)
  To: Zorro Lang, Chao Yu, fstests
  Cc: Ojaswin Mujoo, Qu Wenruo, Darrick J . Wong, Nirjhar Roy,
	Jan Prusakowski

F2FS is a log-structured file system that allocates new blocks even for
overwrites. To perform allocation, it may need to read metadata blocks
(such as the Node Address Table (NAT) or Segment Info Table (SIT)) if
they are not already in memory.

In scenario 3 (read -> read/write), unlike scenario 2, there is no prior
write in the same mount session to load these metadata blocks into memory.
Therefore, the write operation in the second cgroup triggers metadata
reads, which are charged to that cgroup.

Relax the read tolerance for f2fs in scenario 3 to accommodate these
expected metadata reads, matching the tolerance already used in scenario 2.

Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
---
 tests/generic/563 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/generic/563 b/tests/generic/563
index c3705c2f..f95eb073 100755
--- a/tests/generic/563
+++ b/tests/generic/563
@@ -151,7 +151,10 @@ $XFS_IO_PROG -c "pread 0 $iosize" -c "pwrite -b $blksize 0 $iosize" $SCRATCH_MNT
 switch_cg $cgdir
 $XFS_IO_PROG -c fsync $SCRATCH_MNT/file
 check_cg $cgdir/$seq-cg $iosize $iosize 5% 5%
-check_cg $cgdir/$seq-cg-2 0 0 0 0
+# F2FS may perform metadata reads during write in this scenario
+read_tol=0
+[ "$FSTYP" = "f2fs" ] && read_tol=33792
+check_cg $cgdir/$seq-cg-2 0 0 $read_tol 0
 
 if [ "$drop_io_cgroup" = 1 ]; then
 	echo "-io" > $cgdir/cgroup.subtree_control || _fail "subtree control"
-- 
2.54.0.563.g4f69b47b94-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic/563: allow read tolerance for f2fs in scenario 3
  2026-05-15  8:26 [PATCH] generic/563: allow read tolerance for f2fs in scenario 3 Jan Prusakowski
@ 2026-05-20  8:14 ` Chao Yu
  2026-05-20 10:25 ` Zorro Lang
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2026-05-20  8:14 UTC (permalink / raw)
  To: Jan Prusakowski, Zorro Lang, fstests
  Cc: chao, Ojaswin Mujoo, Qu Wenruo, Darrick J . Wong, Nirjhar Roy

On 5/15/2026 4:26 PM, Jan Prusakowski wrote:
> F2FS is a log-structured file system that allocates new blocks even for
> overwrites. To perform allocation, it may need to read metadata blocks
> (such as the Node Address Table (NAT) or Segment Info Table (SIT)) if
> they are not already in memory.
> 
> In scenario 3 (read -> read/write), unlike scenario 2, there is no prior
> write in the same mount session to load these metadata blocks into memory.
> Therefore, the write operation in the second cgroup triggers metadata
> reads, which are charged to that cgroup.
> 
> Relax the read tolerance for f2fs in scenario 3 to accommodate these
> expected metadata reads, matching the tolerance already used in scenario 2.
> 
> Signed-off-by: Jan Prusakowski <jprusakowski@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic/563: allow read tolerance for f2fs in scenario 3
  2026-05-15  8:26 [PATCH] generic/563: allow read tolerance for f2fs in scenario 3 Jan Prusakowski
  2026-05-20  8:14 ` Chao Yu
@ 2026-05-20 10:25 ` Zorro Lang
  1 sibling, 0 replies; 3+ messages in thread
From: Zorro Lang @ 2026-05-20 10:25 UTC (permalink / raw)
  To: Jan Prusakowski
  Cc: Chao Yu, fstests, Ojaswin Mujoo, Qu Wenruo, Darrick J . Wong,
	Nirjhar Roy

On Fri, May 15, 2026 at 08:26:08AM +0000, Jan Prusakowski wrote:
> F2FS is a log-structured file system that allocates new blocks even for
> overwrites. To perform allocation, it may need to read metadata blocks
> (such as the Node Address Table (NAT) or Segment Info Table (SIT)) if
> they are not already in memory.
> 
> In scenario 3 (read -> read/write), unlike scenario 2, there is no prior
> write in the same mount session to load these metadata blocks into memory.
> Therefore, the write operation in the second cgroup triggers metadata
> reads, which are charged to that cgroup.
> 
> Relax the read tolerance for f2fs in scenario 3 to accommodate these
> expected metadata reads, matching the tolerance already used in scenario 2.
> 
> Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
> ---
>  tests/generic/563 | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/563 b/tests/generic/563
> index c3705c2f..f95eb073 100755
> --- a/tests/generic/563
> +++ b/tests/generic/563
> @@ -151,7 +151,10 @@ $XFS_IO_PROG -c "pread 0 $iosize" -c "pwrite -b $blksize 0 $iosize" $SCRATCH_MNT
>  switch_cg $cgdir
>  $XFS_IO_PROG -c fsync $SCRATCH_MNT/file
>  check_cg $cgdir/$seq-cg $iosize $iosize 5% 5%
> -check_cg $cgdir/$seq-cg-2 0 0 0 0
> +# F2FS may perform metadata reads during write in this scenario
> +read_tol=0
> +[ "$FSTYP" = "f2fs" ] && read_tol=33792
> +check_cg $cgdir/$seq-cg-2 0 0 $read_tol 0

Make sense to me,

Reviewed-by: Zorro Lang <zlang@kernel.org>

>  
>  if [ "$drop_io_cgroup" = 1 ]; then
>  	echo "-io" > $cgdir/cgroup.subtree_control || _fail "subtree control"
> -- 
> 2.54.0.563.g4f69b47b94-goog
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-20 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  8:26 [PATCH] generic/563: allow read tolerance for f2fs in scenario 3 Jan Prusakowski
2026-05-20  8:14 ` Chao Yu
2026-05-20 10:25 ` Zorro Lang

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.