On Fri, Jan 28, 2022 at 07:32:53AM +0800, Qu Wenruo wrote: > On 2022/1/27 19:23, Filipe Manana wrote: > > On Thu, Jan 27, 2022 at 01:45:43PM +0800, Qu Wenruo wrote: > >> +get_extent_disk_sector() > >> +{ > >> + local file=$1 > >> + local offset=$2 > >> + > >> + $XFS_IO_PROG -c "fiemap $offset" "$file" | _filter_xfs_io_fiemap |\ > >> + head -n1 | $AWK_PROG '{print $3}' > >> +} > >> + > >> +# Needs 4K sectorsize, as larger sectorsize can change the file layout. > >> +_require_btrfs_support_sectorsize 4096 > >> + > >> +# We need a way to trigger autodefrag > >> +_require_btrfs_debug_cleaner_trigger > > > > In order to trigger the cleaner, we don't need another special purpose > > RFC debug patch. > > > > Just mount the fs with "-o commit=1", and then leave the "sleep 3" as it > > is. We do this in other tests that expect the cleaner thread to do > > something. Every time the transaction kthread wakes up, it will wake up > > the cleaner kthread, even if it doesn't have any transaction to commit. > > Right! That's way better than the RFC patch. Also the BTRFS_IOC_SYNC ioctl (available as "btrfs filesystem sync") will wake the transaction kthread.