FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] xfs/177: let bulkstat finish before reclaim runs
@ 2026-12-03 15:50 Josef Bacik
  2026-12-04  8:29 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2026-12-03 15:50 UTC (permalink / raw)
  To: Zorro Lang; +Cc: Darrick J. Wong, fstests, linux-xfs

xfs/177 fails on a kernel built with KASAN and lockdep, because the
inodes that bulkstat loads are reclaimed before the test counts them.

The test sets xfssyncd_centisecs to 100, and xfs_reclaim_work_queue()
then queues inode reclaim 160 ms after the first inode is tagged:

    xfs_syncd_centisecs / 6 * 10 = 100 / 6 * 10 = 160 ms

On such a kernel in a KVM guest one bulkstat of the 1024 files takes
about as long, so reclaim runs before the test reads the counter:

    bulkstat of the junk directory       134 to 173 ms
    counter read added after bulkstat    1028
    counter read by the test             4

The "inodes after bulkstat" check then fails, since it expects the
test's read to be within 5 of the count taken once the files exist.

Fix by setting xfssyncd_centisecs to 600, which queues reclaim one
second after the first inode is tagged. The sleep that the test derives
from the value stays at two seconds.

Signed-off-by: Josef Bacik <josef@bacik.io>
---
The test with this change passed 10 of 10 runs in KVM guests with KASAN
and lockdep: 5 on v7.3-rc7 and 5 on a development branch based on it.
No run without the change was made alongside, and the test was not run
on a kernel without KASAN and lockdep.
---
 tests/xfs/177 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/xfs/177 b/tests/xfs/177
index 33030f420bc5a..4694cbba75503 100755
--- a/tests/xfs/177
+++ b/tests/xfs/177
@@ -66,10 +66,13 @@ dump_debug_info() {
 xfs_centisecs_file=/proc/sys/fs/xfs/xfssyncd_centisecs
 test -w "$xfs_centisecs_file" || _notrun "Cannot find xfssyncd_centisecs?"
 
-# Set the syncd knob to the minimum value 100cs (aka 1s) so that we don't have
-# to wait forever.
+# Set the syncd knob to a low value so that we don't have to wait forever, but
+# not to the minimum of 100cs: reclaim would then run 160ms after the first
+# inode is tagged, and on a kernel with KASAN and lockdep one bulkstat of the
+# junk directory takes about that long, so the inodes are gone before the test
+# can count them.  600cs gives one second.
 old_centisecs="$(cat "$xfs_centisecs_file")"
-echo 100 > "$xfs_centisecs_file" || _notrun "Cannot adjust xfssyncd_centisecs?"
+echo 600 > "$xfs_centisecs_file" || _notrun "Cannot adjust xfssyncd_centisecs?"
 delay_centisecs="$(cat "$xfs_centisecs_file")"
 
 # Sleep one second more than the xfssyncd delay to give background inode
---
base-commit: 71641219a506ac62bfa231592394265ca812670e
change-id: 20261203-b4-xfs177-bulkstat-reclaim-8cf1191a97e4

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

* Re: [PATCH] xfs/177: let bulkstat finish before reclaim runs
  2026-12-03 15:50 [PATCH] xfs/177: let bulkstat finish before reclaim runs Josef Bacik
@ 2026-12-04  8:29 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2026-12-04  8:29 UTC (permalink / raw)
  To: Josef Bacik; +Cc: Zorro Lang, Darrick J. Wong, fstests, linux-xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

end of thread, other threads:[~2026-12-04  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 15:50 [PATCH] xfs/177: let bulkstat finish before reclaim runs Josef Bacik
2026-12-04  8:29 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox