Skip to contentSkip to conversation

generic/563: allow read tolerance for f2fs in scenario 3

PATCH In review Jan Prusakowski 3 participants 3 messages May 15 – May 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/563: allow read tolerance for f2fs in scenario 3

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.

---
 tests/generic/563 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/generic/563 +4 -1
index c3705c2f..f95eb073 100755
@@ -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"
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · 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.

Quoted 4 lines

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

Thanks,

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Prusakowski
Quoted 23 lines · 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.

---
 tests/generic/563 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tests/generic/563 +0 -0
index c3705c2f..f95eb073 100755

tests/generic/563 $XFS_IO_PROG -c "pread 0 $iosize" -c "pwrite -b $blksize 0 $iosize" $SCRATCH_MNT · line 157

Quoted 8 lines
tests/generic/563 +4 -1
@@ -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,

Quoted 6 lines
tests/generic/563 +0 -0
 if [ "$drop_io_cgroup" = 1 ]; then
 	echo "-io" > $cgdir/cgroup.subtree_control || _fail "subtree control"
Signature · 1 line
2.54.0.563.g4f69b47b94-goog