From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Filipe Manana <fdmanana@kernel.org>, Qu Wenruo <wqu@suse.com>,
fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: add test case to make sure autodefrag won't give up the whole cluster when there is a hole in it
Date: Tue, 1 Feb 2022 16:18:04 +0100 [thread overview]
Message-ID: <20220201151804.GS14046@twin.jikos.cz> (raw)
In-Reply-To: <f76aed97-42a7-ae3e-c7e4-cdbbd2d001c8@gmx.com>
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.
next prev parent reply other threads:[~2022-02-01 15:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 5:45 [PATCH] btrfs: add test case to make sure autodefrag won't give up the whole cluster when there is a hole in it Qu Wenruo
2022-01-27 11:23 ` Filipe Manana
2022-01-27 23:32 ` Qu Wenruo
2022-02-01 15:18 ` David Sterba [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-01-25 9:23 Qu Wenruo
2022-01-25 9:16 Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220201151804.GS14046@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox