* [PATCH] generic/798: exclude nfs from cachestat dirty page reporting test
@ 2026-08-24 15:11 Avinesh Kumar
2026-08-24 16:15 ` Darrick J. Wong
0 siblings, 1 reply; 9+ messages in thread
From: Avinesh Kumar @ 2026-08-24 15:11 UTC (permalink / raw)
To: fstests; +Cc: wqu
From: Avinesh Kumar <avinesh.kumar@suse.com>
generic/798 checks cachestat() page cache dirty state between write and
fsync operations.
On NFS, the client flushes dirty pages to the server during close() to
enforce its close-to-open consistency model. Because the test uses separate
xfs_io invocations, the file is closed after writing, leaving pages already
clean by the time the subsequent cachestat command executes, causing the
test to fail.
- output mismatch (see /opt/xfstests/results//generic/798.out.bad)
--- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400
+++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400
@@ -1,16 +1,16 @@
QA output created by 798
=== Test with 1 pages ===
-Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0
+Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0
Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0
=== Test with 2 pages ===
-Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0
...
Exclude 'nfs' from running this test.
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
tests/generic/798 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/generic/798 b/tests/generic/798
index 0fe37646..80b2acc9 100755
--- a/tests/generic/798
+++ b/tests/generic/798
@@ -16,6 +16,12 @@ _require_scratch
_exclude_scratch_mount_option "dax"
_exclude_scratch_mount_option "sync"
+# NFS flushes dirty data back to the server on close() as part of its
+# close-to-open cache consistency model, so a page written and closed in
+# one xfs_io invocation is no longer dirty by the time cachestat runs in
+# a later invocation.
+_exclude_fs nfs
+
pagesize=$(_get_page_size)
_scratch_mkfs > /dev/null
--
2.55.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] generic/798: exclude nfs from cachestat dirty page reporting test 2026-08-24 15:11 [PATCH] generic/798: exclude nfs from cachestat dirty page reporting test Avinesh Kumar @ 2026-08-24 16:15 ` Darrick J. Wong 2026-08-26 14:39 ` Avinesh Kumar 2026-08-26 15:01 ` [PATCH v2] generic/798: chain xfs_io commands into a single invocation Avinesh Kumar 0 siblings, 2 replies; 9+ messages in thread From: Darrick J. Wong @ 2026-08-24 16:15 UTC (permalink / raw) To: Avinesh Kumar; +Cc: fstests, wqu On Mon, Aug 24, 2026 at 05:11:06PM +0200, Avinesh Kumar wrote: > From: Avinesh Kumar <avinesh.kumar@suse.com> > > generic/798 checks cachestat() page cache dirty state between write and > fsync operations. > > On NFS, the client flushes dirty pages to the server during close() to > enforce its close-to-open consistency model. Because the test uses separate > xfs_io invocations, the file is closed after writing, leaving pages already > clean by the time the subsequent cachestat command executes, causing the > test to fail. > > - output mismatch (see /opt/xfstests/results//generic/798.out.bad) > --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 > +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 > @@ -1,16 +1,16 @@ > QA output created by 798 > === Test with 1 pages === > -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 > +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > === Test with 2 pages === > -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 > ... > > Exclude 'nfs' from running this test. > > Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> > --- > tests/generic/798 | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/tests/generic/798 b/tests/generic/798 > index 0fe37646..80b2acc9 100755 > --- a/tests/generic/798 > +++ b/tests/generic/798 > @@ -16,6 +16,12 @@ _require_scratch > _exclude_scratch_mount_option "dax" > _exclude_scratch_mount_option "sync" > > +# NFS flushes dirty data back to the server on close() as part of its > +# close-to-open cache consistency model, so a page written and closed in > +# one xfs_io invocation is no longer dirty by the time cachestat runs in > +# a later invocation. > +_exclude_fs nfs Could you just chain all the xfs_io commands together into a single invocation? $XFS_IO_PROG -f \ -c "pwrite -b $pagesize 0 $size" \ -c "cachestat 0 $size" \ -c "fsync" \ -c "cachestat 0 $size" \ $SCRATCH_MNT/foobar to solve this problem? --D > + > pagesize=$(_get_page_size) > > _scratch_mkfs > /dev/null > -- > 2.55.0 > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] generic/798: exclude nfs from cachestat dirty page reporting test 2026-08-24 16:15 ` Darrick J. Wong @ 2026-08-26 14:39 ` Avinesh Kumar 2026-08-26 15:01 ` [PATCH v2] generic/798: chain xfs_io commands into a single invocation Avinesh Kumar 1 sibling, 0 replies; 9+ messages in thread From: Avinesh Kumar @ 2026-08-26 14:39 UTC (permalink / raw) To: Darrick J. Wong; +Cc: fstests, wqu Hello Darrick, >> diff --git a/tests/generic/798 b/tests/generic/798 >> index 0fe37646..80b2acc9 100755 >> --- a/tests/generic/798 >> +++ b/tests/generic/798 >> @@ -16,6 +16,12 @@ _require_scratch >> _exclude_scratch_mount_option "dax" >> _exclude_scratch_mount_option "sync" >> >> +# NFS flushes dirty data back to the server on close() as part of its >> +# close-to-open cache consistency model, so a page written and closed in >> +# one xfs_io invocation is no longer dirty by the time cachestat runs in >> +# a later invocation. >> +_exclude_fs nfs > > Could you just chain all the xfs_io commands together into a single > invocation? > > $XFS_IO_PROG -f \ > -c "pwrite -b $pagesize 0 $size" \ > -c "cachestat 0 $size" \ > -c "fsync" \ > -c "cachestat 0 $size" \ > $SCRATCH_MNT/foobar > > to solve this problem? > Thanks for the review and this suggestion. Chaining all xfs_io commands together seems to work, with also passing '-q' to pwrite to suppress these lines - +wrote 4096/4096 bytes at offset 0 +4 KiB, 1 ops; 0.0000 sec (355.114 MiB/sec and 90909.0909 ops/sec) I am sending revised patch. Regards, Avinesh ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2] generic/798: chain xfs_io commands into a single invocation 2026-08-24 16:15 ` Darrick J. Wong 2026-08-26 14:39 ` Avinesh Kumar @ 2026-08-26 15:01 ` Avinesh Kumar 2026-08-26 15:20 ` Darrick J. Wong 1 sibling, 1 reply; 9+ messages in thread From: Avinesh Kumar @ 2026-08-26 15:01 UTC (permalink / raw) To: fstests; +Cc: wqu, Darrick J. Wong From: Avinesh Kumar <avinesh.kumar@suse.com> The write, cachestat, fsync, and cachestat calls were each run as separate xfs_io invocations, closing and reopening the file in between. Some filesystems flush dirty data back on close(), clearing the dirty bit before the first cachestat ever ran, causing test failure - output mismatch (see /opt/xfstests/results//generic/798.out.bad) --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 @@ -1,16 +1,16 @@ QA output created by 798 === Test with 1 pages === -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 === Test with 2 pages === -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 ... Run the whole sequence on one open file descriptor instead by chaining all xfs_io commands in single invocation. Suggested-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> --- tests/generic/798 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/generic/798 b/tests/generic/798 index 0fe37646..171878ee 100755 --- a/tests/generic/798 +++ b/tests/generic/798 @@ -27,12 +27,22 @@ for num_page in 1 2 4 8 16; do echo "=== Test with $num_page pages ===" rm -f $SCRATCH_MNT/foobar - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null - # Basic cached number reporting - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar - # Test dirty page number reporting after a fsync. + # Basic cached number reporting and test dirty page number + # reporting after a fsync. + # + # Do the whole write+cachestat+fsync+cachestat sequence in a + # single xfs_io invocation. Some filesystems (e.g. NFS) flush + # dirty data back to the server as part of their own close()-time + # cache consistency, which would clear the dirty bits before the + # second xfs_io process ever got to run cachestat. $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar + $XFS_IO_PROG -f \ + -c "pwrite -q -b $pagesize 0 $size" \ + -c "cachestat 0 $size" \ + -c "fsync" \ + -c "cachestat 0 $size" \ + $SCRATCH_MNT/foobar done _scratch_unmount -- 2.55.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2] generic/798: chain xfs_io commands into a single invocation 2026-08-26 15:01 ` [PATCH v2] generic/798: chain xfs_io commands into a single invocation Avinesh Kumar @ 2026-08-26 15:20 ` Darrick J. Wong 2026-08-26 15:54 ` [PATCH v3] " Avinesh Kumar 0 siblings, 1 reply; 9+ messages in thread From: Darrick J. Wong @ 2026-08-26 15:20 UTC (permalink / raw) To: Avinesh Kumar; +Cc: fstests, wqu On Wed, Aug 26, 2026 at 05:01:14PM +0200, Avinesh Kumar wrote: > From: Avinesh Kumar <avinesh.kumar@suse.com> > > The write, cachestat, fsync, and cachestat calls were each run as > separate xfs_io invocations, closing and reopening the file in > between. Some filesystems flush dirty data back on close(), clearing > the dirty bit before the first cachestat ever ran, causing test failure > > - output mismatch (see /opt/xfstests/results//generic/798.out.bad) > --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 > +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 > @@ -1,16 +1,16 @@ > QA output created by 798 > === Test with 1 pages === > -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 > +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > === Test with 2 pages === > -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 > ... > > Run the whole sequence on one open file descriptor instead by chaining > all xfs_io commands in single invocation. > > Suggested-by: "Darrick J. Wong" <djwong@kernel.org> > Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> > --- > tests/generic/798 | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/tests/generic/798 b/tests/generic/798 > index 0fe37646..171878ee 100755 > --- a/tests/generic/798 > +++ b/tests/generic/798 > @@ -27,12 +27,22 @@ for num_page in 1 2 4 8 16; do > echo "=== Test with $num_page pages ===" > > rm -f $SCRATCH_MNT/foobar > - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null > - # Basic cached number reporting > - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar > > - # Test dirty page number reporting after a fsync. > + # Basic cached number reporting and test dirty page number > + # reporting after a fsync. > + # > + # Do the whole write+cachestat+fsync+cachestat sequence in a > + # single xfs_io invocation. Some filesystems (e.g. NFS) flush > + # dirty data back to the server as part of their own close()-time > + # cache consistency, which would clear the dirty bits before the > + # second xfs_io process ever got to run cachestat. > $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar > + $XFS_IO_PROG -f \ Not sure why there are two $XFS_IO_PROG invocations here?? Also the first line of the second invocation should only be indented one tab, not two. --D > + -c "pwrite -q -b $pagesize 0 $size" \ > + -c "cachestat 0 $size" \ > + -c "fsync" \ > + -c "cachestat 0 $size" \ > + $SCRATCH_MNT/foobar > done > > _scratch_unmount > -- > 2.55.0 > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3] generic/798: chain xfs_io commands into a single invocation 2026-08-26 15:20 ` Darrick J. Wong @ 2026-08-26 15:54 ` Avinesh Kumar 2026-08-26 16:15 ` Darrick J. Wong ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Avinesh Kumar @ 2026-08-26 15:54 UTC (permalink / raw) To: djwong, fstests; +Cc: avinesh.kumar, wqu From: Avinesh Kumar <avinesh.kumar@suse.com> The write, cachestat, fsync, and cachestat calls were each run as separate xfs_io invocations, closing and reopening the file in between. Some filesystems flush dirty data back on close(), clearing the dirty bit before the first cachestat ever ran, causing test failure - output mismatch (see /opt/xfstests/results//generic/798.out.bad) --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 @@ -1,16 +1,16 @@ QA output created by 798 === Test with 1 pages === -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 === Test with 2 pages === -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 ... Run the whole sequence on one open file descriptor instead by chaining all xfs_io commands in single invocation. Suggested-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> --- tests/generic/798 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/generic/798 b/tests/generic/798 index 0fe37646..5c81b429 100755 --- a/tests/generic/798 +++ b/tests/generic/798 @@ -27,12 +27,21 @@ for num_page in 1 2 4 8 16; do echo "=== Test with $num_page pages ===" rm -f $SCRATCH_MNT/foobar - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null - # Basic cached number reporting - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar - # Test dirty page number reporting after a fsync. - $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar + # Basic cached number reporting and test dirty page number + # reporting after a fsync. + # + # Do the whole write+cachestat+fsync+cachestat sequence in a + # single xfs_io invocation. Some filesystems (e.g. NFS) flush + # dirty data back to the server as part of their own close()-time + # cache consistency, which would clear the dirty bits before the + # second xfs_io process ever got to run cachestat. + $XFS_IO_PROG -f \ + -c "pwrite -q -b $pagesize 0 $size" \ + -c "cachestat 0 $size" \ + -c "fsync" \ + -c "cachestat 0 $size" \ + $SCRATCH_MNT/foobar done _scratch_unmount -- 2.55.0 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3] generic/798: chain xfs_io commands into a single invocation 2026-08-26 15:54 ` [PATCH v3] " Avinesh Kumar @ 2026-08-26 16:15 ` Darrick J. Wong 2026-08-26 17:00 ` Zorro Lang 2026-08-26 22:13 ` Qu Wenruo 2 siblings, 0 replies; 9+ messages in thread From: Darrick J. Wong @ 2026-08-26 16:15 UTC (permalink / raw) To: Avinesh Kumar; +Cc: fstests, wqu On Wed, Aug 26, 2026 at 05:54:23PM +0200, Avinesh Kumar wrote: > From: Avinesh Kumar <avinesh.kumar@suse.com> > > The write, cachestat, fsync, and cachestat calls were each run as > separate xfs_io invocations, closing and reopening the file in > between. Some filesystems flush dirty data back on close(), clearing > the dirty bit before the first cachestat ever ran, causing test failure > > - output mismatch (see /opt/xfstests/results//generic/798.out.bad) > --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 > +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 > @@ -1,16 +1,16 @@ > QA output created by 798 > === Test with 1 pages === > -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 > +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > === Test with 2 pages === > -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 > ... > > Run the whole sequence on one open file descriptor instead by chaining > all xfs_io commands in single invocation. > > Suggested-by: "Darrick J. Wong" <djwong@kernel.org> > Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> Looks good now! Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > --- > tests/generic/798 | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/tests/generic/798 b/tests/generic/798 > index 0fe37646..5c81b429 100755 > --- a/tests/generic/798 > +++ b/tests/generic/798 > @@ -27,12 +27,21 @@ for num_page in 1 2 4 8 16; do > echo "=== Test with $num_page pages ===" > > rm -f $SCRATCH_MNT/foobar > - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null > - # Basic cached number reporting > - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar > > - # Test dirty page number reporting after a fsync. > - $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar > + # Basic cached number reporting and test dirty page number > + # reporting after a fsync. > + # > + # Do the whole write+cachestat+fsync+cachestat sequence in a > + # single xfs_io invocation. Some filesystems (e.g. NFS) flush > + # dirty data back to the server as part of their own close()-time > + # cache consistency, which would clear the dirty bits before the > + # second xfs_io process ever got to run cachestat. > + $XFS_IO_PROG -f \ > + -c "pwrite -q -b $pagesize 0 $size" \ > + -c "cachestat 0 $size" \ > + -c "fsync" \ > + -c "cachestat 0 $size" \ > + $SCRATCH_MNT/foobar > done > > _scratch_unmount > -- > 2.55.0 > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3] generic/798: chain xfs_io commands into a single invocation 2026-08-26 15:54 ` [PATCH v3] " Avinesh Kumar 2026-08-26 16:15 ` Darrick J. Wong @ 2026-08-26 17:00 ` Zorro Lang 2026-08-26 22:13 ` Qu Wenruo 2 siblings, 0 replies; 9+ messages in thread From: Zorro Lang @ 2026-08-26 17:00 UTC (permalink / raw) To: Avinesh Kumar; +Cc: djwong, fstests, wqu On Wed, Aug 26, 2026 at 05:54:23PM +0200, Avinesh Kumar wrote: > From: Avinesh Kumar <avinesh.kumar@suse.com> > > The write, cachestat, fsync, and cachestat calls were each run as > separate xfs_io invocations, closing and reopening the file in > between. Some filesystems flush dirty data back on close(), clearing > the dirty bit before the first cachestat ever ran, causing test failure > > - output mismatch (see /opt/xfstests/results//generic/798.out.bad) > --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 > +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 > @@ -1,16 +1,16 @@ > QA output created by 798 > === Test with 1 pages === > -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 > +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > === Test with 2 pages === > -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 > ... > > Run the whole sequence on one open file descriptor instead by chaining > all xfs_io commands in single invocation. > > Suggested-by: "Darrick J. Wong" <djwong@kernel.org> > Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> > --- This change is good to me, Reviewed-by: Zorro Lang <zlang@kernel.org> > tests/generic/798 | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/tests/generic/798 b/tests/generic/798 > index 0fe37646..5c81b429 100755 > --- a/tests/generic/798 > +++ b/tests/generic/798 > @@ -27,12 +27,21 @@ for num_page in 1 2 4 8 16; do > echo "=== Test with $num_page pages ===" > > rm -f $SCRATCH_MNT/foobar > - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null > - # Basic cached number reporting > - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar > > - # Test dirty page number reporting after a fsync. > - $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar > + # Basic cached number reporting and test dirty page number > + # reporting after a fsync. > + # > + # Do the whole write+cachestat+fsync+cachestat sequence in a > + # single xfs_io invocation. Some filesystems (e.g. NFS) flush > + # dirty data back to the server as part of their own close()-time > + # cache consistency, which would clear the dirty bits before the > + # second xfs_io process ever got to run cachestat. > + $XFS_IO_PROG -f \ > + -c "pwrite -q -b $pagesize 0 $size" \ > + -c "cachestat 0 $size" \ > + -c "fsync" \ > + -c "cachestat 0 $size" \ > + $SCRATCH_MNT/foobar > done > > _scratch_unmount > -- > 2.55.0 > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3] generic/798: chain xfs_io commands into a single invocation 2026-08-26 15:54 ` [PATCH v3] " Avinesh Kumar 2026-08-26 16:15 ` Darrick J. Wong 2026-08-26 17:00 ` Zorro Lang @ 2026-08-26 22:13 ` Qu Wenruo 2 siblings, 0 replies; 9+ messages in thread From: Qu Wenruo @ 2026-08-26 22:13 UTC (permalink / raw) To: Avinesh Kumar, djwong, fstests; +Cc: wqu 在 2026/8/27 01:24, Avinesh Kumar 写道: > From: Avinesh Kumar <avinesh.kumar@suse.com> > > The write, cachestat, fsync, and cachestat calls were each run as > separate xfs_io invocations, closing and reopening the file in > between. Some filesystems flush dirty data back on close(), clearing > the dirty bit before the first cachestat ever ran, causing test failure > > - output mismatch (see /opt/xfstests/results//generic/798.out.bad) > --- tests/generic/798.out 2026-08-20 05:25:39.000000000 -0400 > +++ /opt/xfstests/results//generic/798.out.bad 2026-08-21 12:30:39.831381108 -0400 > @@ -1,16 +1,16 @@ > QA output created by 798 > === Test with 1 pages === > -Cached: 1, Dirty: 1, Writeback: 0, Evicted: 0, Recently Evicted: 0 > +Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > Cached: 1, Dirty: 0, Writeback: 0, Evicted: 0, Recently Evicted: 0 > === Test with 2 pages === > -Cached: 2, Dirty: 2, Writeback: 0, Evicted: 0, Recently Evicted: 0 > ... > > Run the whole sequence on one open file descriptor instead by chaining > all xfs_io commands in single invocation. > > Suggested-by: "Darrick J. Wong" <djwong@kernel.org> > Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > tests/generic/798 | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/tests/generic/798 b/tests/generic/798 > index 0fe37646..5c81b429 100755 > --- a/tests/generic/798 > +++ b/tests/generic/798 > @@ -27,12 +27,21 @@ for num_page in 1 2 4 8 16; do > echo "=== Test with $num_page pages ===" > > rm -f $SCRATCH_MNT/foobar > - $XFS_IO_PROG -f -c "pwrite -b $pagesize 0 $size" $SCRATCH_MNT/foobar > /dev/null > - # Basic cached number reporting > - $XFS_IO_PROG -c "cachestat 0 $size" $SCRATCH_MNT/foobar > > - # Test dirty page number reporting after a fsync. > - $XFS_IO_PROG -c "fsync" -c "cachestat 0 $size" $SCRATCH_MNT/foobar > + # Basic cached number reporting and test dirty page number > + # reporting after a fsync. > + # > + # Do the whole write+cachestat+fsync+cachestat sequence in a > + # single xfs_io invocation. Some filesystems (e.g. NFS) flush > + # dirty data back to the server as part of their own close()-time > + # cache consistency, which would clear the dirty bits before the > + # second xfs_io process ever got to run cachestat. > + $XFS_IO_PROG -f \ > + -c "pwrite -q -b $pagesize 0 $size" \ > + -c "cachestat 0 $size" \ > + -c "fsync" \ > + -c "cachestat 0 $size" \ > + $SCRATCH_MNT/foobar > done > > _scratch_unmount ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-08-26 22:13 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-08-24 15:11 [PATCH] generic/798: exclude nfs from cachestat dirty page reporting test Avinesh Kumar 2026-08-24 16:15 ` Darrick J. Wong 2026-08-26 14:39 ` Avinesh Kumar 2026-08-26 15:01 ` [PATCH v2] generic/798: chain xfs_io commands into a single invocation Avinesh Kumar 2026-08-26 15:20 ` Darrick J. Wong 2026-08-26 15:54 ` [PATCH v3] " Avinesh Kumar 2026-08-26 16:15 ` Darrick J. Wong 2026-08-26 17:00 ` Zorro Lang 2026-08-26 22:13 ` Qu Wenruo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).