From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Dave Chinner <david@fromorbit.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs_io: support a basic extent swap command
Date: Thu, 8 Feb 2018 08:06:19 -0500 [thread overview]
Message-ID: <20180208130618.GA13929@bfoster.bfoster> (raw)
In-Reply-To: <20180207232319.GA5433@magnolia>
On Wed, Feb 07, 2018 at 03:23:19PM -0800, Darrick J. Wong wrote:
> On Thu, Feb 08, 2018 at 10:02:17AM +1100, Dave Chinner wrote:
> > On Wed, Feb 07, 2018 at 09:47:12AM -0500, Brian Foster wrote:
> > > On Wed, Feb 07, 2018 at 12:34:41PM +1100, Dave Chinner wrote:
> > > > On Tue, Feb 06, 2018 at 08:02:47AM -0500, Brian Foster wrote:
> > > > > Extent swap is a low level mechanism exported by XFS to facilitate
> > > > > filesystem defragmentation. It is typically invoked by xfs_fsr under
> > > > > conditions that will atomically adjust inode extent state without
> > > > > loss of file data.
> > > > >
> > > > > xfs_fsr does not provide the necessary controls for low-level
> > > > > testing of the extent swap command, however. For example, xfs_fsr
> > > > > implements policies that dictate when to perform an extent swap and
> > > > > offers no control over the donor file characteristics.
> > > >
> > > > Hmmmm. I'm confused - we already use xfs_fsr for low level testing
> > > > of swapext functionality with carefully constructed donor file
> > > > characteristics in xfs/227.
> > > >
> > > > What am I missing here?
> > > >
> > >
> > > AFAICT, xfs/227 does so by formatting the filesystem in a particular way
> > > and running fsr over it, so it wasn't immediately clear to me what
> > > you're referring to. Staring at it some more, it appears to be using the
> > > -C debug option which looks like it forces an extent count..? If that's
> > > the case, the test[1] that was posted to use this feature could probably
> > > be modified to do a similar thing via xfs_fsr.
> > >
> > > Giving it a quick test, it doesn't appear to do exactly what I want with
> > > larger extent counts, however. It seems to work with a few extents or
> > > so, then doesn't ever create more than 4 or 5 if that's what I ask for
> > > with the donor file. Hmm, I wonder if prealloc or something is getting
> > > in the way of whatever it's attempting to do. If I try a similar test
> > > using falloc instead of pwrite, it doesn't do the swap at all. :/
> >
> > Yeah, that's because of the way xfs_fsr preserves unwritten extents
> > across defragmentation. i.e. it assumes unwritten extents are a
> > result of application level preallocation and so it's there
> > intentionally and be preserved.
> >
> > When I wrote this yesterday, I hadn't see the test you'd posted to
> > the fstests list so I didn't have that context. Now that I've seen
> > it, and you've explained the problems, I can see why you wrote the
> > simpler xfs_io test command....
> >
> > [....]
> >
> > > So unless there's any objections, I can try to reword the commit log for
> > > this patch to make the advantages/differences more clear.
> >
> > Yeah, I think that's all that is necessary - just expand on
> > "xfs_fsr does not provide the necessary controls" a bit so I don't
> > have to rely on my brain to remember this conversation. :P
>
> <shrug> I had figured xfs_fsr == "polished user program not to be
> cluttered up with weird xfstests warts" and xfs_io == "warty program we
> use to make raw calls for testing" so except for tests that check the
> behavior of xfs_fsr itself, there ought to be a raw interface via xfs_io
> that regression tests use directly. :)
>
Yep. I thought about adding an input file param or some such to xfs_fsr
for about 3 seconds or so, then came to the same conclusion. ;P
Brian
> --D
>
> > Cheers,
> >
> > Dave.
> > --
> > Dave Chinner
> > david@fromorbit.com
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2018-02-08 13:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 13:02 [PATCH] xfs_io: support a basic extent swap command Brian Foster
2018-02-06 17:32 ` Darrick J. Wong
2018-02-06 18:49 ` Brian Foster
2018-02-07 1:34 ` Dave Chinner
2018-02-07 14:47 ` Brian Foster
2018-02-07 23:02 ` Dave Chinner
2018-02-07 23:23 ` Darrick J. Wong
2018-02-08 13:06 ` Brian Foster [this message]
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=20180208130618.GA13929@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).