Greeting,
FYI, we noticed the following commit (built with gcc-11):
commit: 66a7a2412f2b5079a148934edeba2833fccc0490 ("[PATCH] btrfs: use preallocated page for super block write")
url: https://github.com/intel-lab-lkp/linux/commits/David-Sterba/btrfs-use-preallocated-page-for-super-block-write/20220607-235131
base: https://git.kernel.org/cgit/linux/kernel/git/kdave/linux.git for-next
patch link: https://lore.kernel.org/linux-btrfs/[email protected]
in testcase: xfstests
version: xfstests-x86_64-c1144bf-1_20220613
with following parameters:
disk: 6HDD
fs: btrfs
test: btrfs-group-13
ucode: 0x28
test-description: xfstests is a regression test suite for xfs and other files ystems.
test-url: git://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git
on test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz with 8G memory
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email protected]>
2022-06-15 18:54:01 export TEST_DIR=/fs/sdb1
2022-06-15 18:54:01 export TEST_DEV=/dev/sdb1
2022-06-15 18:54:01 export FSTYP=btrfs
2022-06-15 18:54:01 export SCRATCH_MNT=/fs/scratch
2022-06-15 18:54:01 mkdir /fs/scratch -p
2022-06-15 18:54:01 export SCRATCH_DEV_POOL="/dev/sdb2 /dev/sdb3 /dev/sdb4 /dev/sdb5 /dev/sdb6"
2022-06-15 18:54:01 sed "s:^:btrfs/:" //lkp/benchmarks/xfstests/tests/btrfs-group-13
2022-06-15 18:54:01 ./check btrfs/131 btrfs/132 btrfs/133 btrfs/134 btrfs/135 btrfs/136 btrfs/137 btrfs/138 btrfs/139
FSTYP -- btrfs
PLATFORM -- Linux/x86_64 lkp-hsw-d01 5.19.0-rc1-00087-g66a7a2412f2b #1 SMP Tue Jun 14 21:19:44 CST 2022
MKFS_OPTIONS -- /dev/sdb2
MOUNT_OPTIONS -- /dev/sdb2 /fs/scratch
btrfs/131 - output mismatch (see /lkp/benchmarks/xfstests/results//btrfs/131.out.bad)
--- tests/btrfs/131.out 2022-06-13 17:10:24.000000000 +0000
+++ /lkp/benchmarks/xfstests/results//btrfs/131.out.bad 2022-06-15 18:54:06.505508542 +0000
@@ -2,9 +2,9 @@
Using free space cache
free space tree is disabled
Enabling free space tree
-free space tree is enabled
+free space tree is disabled
Disabling free space cache and enabling free space tree
-free space tree is enabled
...
(Run 'diff -u /lkp/benchmarks/xfstests/tests/btrfs/131.out /lkp/benchmarks/xfstests/results//btrfs/131.out.bad' to see the entire diff)
btrfs/132 33s
btrfs/133 2s
btrfs/134 2s
btrfs/135 2s
btrfs/136 122s
btrfs/137 2s
btrfs/138 65s
btrfs/139 98s
Ran: btrfs/131 btrfs/132 btrfs/133 btrfs/134 btrfs/135 btrfs/136 btrfs/137 btrfs/138 btrfs/139
Failures: btrfs/131
Failed 1 of 9 tests
To reproduce:
git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
sudo bin/lkp install job.yaml # job file is attached in this email
bin/lkp split-job --compatible job.yaml # generate the yaml file for lkp run
sudo bin/lkp run generated-yaml-file
# if come across any failure that blocks the test,
# please remove ~/.lkp and /lkp dir to run from a clean state.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
On Thu, Jun 16, 2022 at 10:37:10PM +0800, kernel test robot wrote:
> btrfs/131 - output mismatch (see /lkp/benchmarks/xfstests/results//btrfs/131.out.bad)
> --- tests/btrfs/131.out 2022-06-13 17:10:24.000000000 +0000
> +++ /lkp/benchmarks/xfstests/results//btrfs/131.out.bad 2022-06-15 18:54:06.505508542 +0000
> @@ -2,9 +2,9 @@
> Using free space cache
> free space tree is disabled
> Enabling free space tree
> -free space tree is enabled
> +free space tree is disabled
I think I know what's going on here:
compat_ro="$($BTRFS_UTIL_PROG inspect-internal dump-super "$SCRATCH_DEV"
| \
sed -rn 's/^compat_ro_flags\s+(.*)$/\1/p')"
if ((compat_ro & 0x1)); then
echo "free space tree is enabled"
else
echo "free space tree is disabled"
fi
dump-super is reading the super block out of the page cache, but this
change makes the page cache incoherent with what's on disc. We could
fix that by invalidating the page out of the page cache, but it may be
easier to just dump this patch and fix how we use the page cache to
write back the superblocks?
On Thu, Jun 16, 2022 at 10:17:11PM +0100, Matthew Wilcox wrote:
> On Thu, Jun 16, 2022 at 10:37:10PM +0800, kernel test robot wrote:
> > btrfs/131 - output mismatch (see /lkp/benchmarks/xfstests/results//btrfs/131.out.bad)
> > --- tests/btrfs/131.out 2022-06-13 17:10:24.000000000 +0000
> > +++ /lkp/benchmarks/xfstests/results//btrfs/131.out.bad 2022-06-15 18:54:06.505508542 +0000
> > @@ -2,9 +2,9 @@
> > Using free space cache
> > free space tree is disabled
> > Enabling free space tree
> > -free space tree is enabled
> > +free space tree is disabled
>
> I think I know what's going on here:
>
> compat_ro="$($BTRFS_UTIL_PROG inspect-internal dump-super "$SCRATCH_DEV"
> | \
> sed -rn 's/^compat_ro_flags\s+(.*)$/\1/p')"
> if ((compat_ro & 0x1)); then
> echo "free space tree is enabled"
> else
> echo "free space tree is disabled"
> fi
>
> dump-super is reading the super block out of the page cache, but this
> change makes the page cache incoherent with what's on disc. We could
> fix that by invalidating the page out of the page cache, but it may be
> easier to just dump this patch and fix how we use the page cache to
> write back the superblocks?
The build bot picks up the branch with some delay, I've removed it from
the pushed branches. It's interesting to see that using the page cache
vs direct write does have effects in tests, so it would need to be
unified in kernel and user space.