linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs_io: support a basic extent swap command
Date: Thu, 8 Feb 2018 10:02:17 +1100	[thread overview]
Message-ID: <20180207230217.GA20367@dastard> (raw)
In-Reply-To: <20180207144711.GA9789@bfoster.bfoster>

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

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2018-02-07 23:04 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 [this message]
2018-02-07 23:23       ` Darrick J. Wong
2018-02-08 13:06         ` Brian Foster

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=20180207230217.GA20367@dastard \
    --to=david@fromorbit.com \
    --cc=bfoster@redhat.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).