On 12/04/2021 16:09, Filipe Manana wrote: >> [ 81.014752] BTRFS info (device nullb0): reclaiming chunk 1073741824 >> [ 81.015732] BTRFS info (device nullb0): relocating block group 1073741824 >> flags data >> [ 81.798090] BTRFS info (device nullb0): found 12452 extents, stage: move >> data extents >> [ 82.314562] BTRFS info (device nullb0): found 12452 extents, stage: >> update data pointers >> # blkzone report -o $((1073741824 >> 9)) -c 1 /dev/nullb0 >> start: 0x000200000, len 0x080000, cap 0x080000, wptr 0x0799a0 reset:0 >> non-seq:0, zcond: 2(oi) [type: 2(SEQ_WRITE_REQUIRED)] > > Not familiar with zoned device details, but what you are passing to > blkzone is a logical address, in non-zoned btrfs it does not always > matches the physical address on disk. > So maybe that is not a reliable way to check it.
Yep need to find a more reliable way to use in fstests later, but as of now, it works for debugging. >> >> Whereas when the this patch is applied as well: >> [ 85.126542] BTRFS info (device nullb0): reclaiming chunk 1073741824 >> [ 85.128211] BTRFS info (device nullb0): relocating block group 1073741824 >> flags data >> [ 86.061831] BTRFS info (device nullb0): found 12452 extents, stage: move >> data extents >> [ 86.766549] BTRFS info (device nullb0): found 12452 extents, stage: >> update data pointers >> # blkzone report -c 1 -o $((1073741824 >> 9)) /dev/nullb0 >> start: 0x000200000, len 0x080000, cap 0x080000, wptr 0x000000 reset:0 >> non-seq:0, zcond: 1(em) [type: 2(SEQ_WRITE_REQUIRED)] >> >> As a positive side effect of this, I now have code that can be used in >> xfstests to verify the patchset. > > Ok. > Maybe the zone isn't reset properly because the default mechanism is > doing smaller discards, on a per extent basis, and perhaps the order > of those discards matters? > > If it affects only the zoned case, I also don't see why doing it when > not in zoned mode (and -o discard=sync is set). > Unless of course the default discard mechanism is broken somehow, in > which case we need to find out why and fix it. I'm at it.