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: [RFC PATCH 0/14] xfs: Towards thin provisioning aware filesystems
Date: Wed, 1 Nov 2017 11:45:13 +1100	[thread overview]
Message-ID: <20171101004513.GK5858@dastard> (raw)
In-Reply-To: <20171031112432.GA7093@bfoster.bfoster>

On Tue, Oct 31, 2017 at 07:24:32AM -0400, Brian Foster wrote:
> On Tue, Oct 31, 2017 at 08:09:41AM +1100, Dave Chinner wrote:
> > On Mon, Oct 30, 2017 at 09:31:17AM -0400, Brian Foster wrote:
> > > On Thu, Oct 26, 2017 at 07:33:08PM +1100, Dave Chinner wrote:
> > > > This patchset is aimed at filesystems that are installed on sparse
> > > > block devices, a.k.a thin provisioned devices. The aim of the
> > > > patchset is to bring the space management aspect of the storage
> > > > stack up into the filesystem rather than keeping it below the
> > > > filesystem where users and the filesystem have no clue they are
> > > > about to run out of space.
....
> > I get that "total_blocks" sounds better, but to me that's a capacity
> > measurement, not an indication of the size of the underlying address
> > space the block device has provided. m_usable_blocks is obviously a
> > capacity measurement, but I was trying to convey that m_LBA_size is
> > not a capacity measurement but an externally imposed addressing
> > limit.
> > 
> > <shrug>
> > 
> > I guess if I document it well enough m_total_blocks will work.
> > 
> 
> Hmm, yeah I see what you mean. Unfortunately I can't really think of
> anything aside from m_total_blocks or perhaps m_phys_blocks at the
> moment.

m_phys_blocks seems closer to the intent. If that's acceptible I'll
change the code to that.

> > > Finally, I tend to agree with Amir's comment with regard to
> > > shrink/growfs... at least infosar as I understand his concern. If we do
> > > support physical shrink in the future, what do we expect the interface
> > > to look like in light of this change?
> > 
> > I don't expect it to look any different. It's exactly the same as
> > growfs - thinspace filesystem will simply do a logical grow/shrink,
> > fat filesystems will need to do a physical grow/shrink
> > adding/removing AGs.
> > 
> 
> How would you physically shrink a thin filesystem?

You wouldn't. There should never be a need to do this because it a
thinspace shrink doesn't actually free any space - it's just a usage
limit. fstrim is what actually shrinks the storage space used,
regardless of the current maximum capcity of the thin filesystem.

So I don't really see any point in physically shrink a thin
filesystem because that defeats the entire purpose of having a thin
filesystem in the first place.

> > > Given that this already requires on-disk changes and the addition of a
> > > feature bit, it seems prudent to me to update the growfs API
> > > accordingly. Isn't a growfs new_usable_blocks field or some such all we
> > > really need to address that concern?
> > 
> > I really do not see any reason for changing the growfs interface
> > right now. If there's a problem in future that physical shrink
> > introduces, we can rev the interface when the problem arises.
> > 
> 
> Indeed. I'm not terribly concerned about the growfs interface, but in
> the interest of trying to make sure the point is clear... does that mean
> we'd add a new usable_blocks field to the growfs structure if/when
> physical shrink is supported?

No. growfs simply says "grow/shrink to size X" and the kernel then
determines if a physical or thin grow/shrink operation is performed
and does the work/checks appropriate to make that work.

The only thing we need to ensure is that growfs has the necessary
info to correctly set the size of the filesystem when it is doing
operations that don't want to change the size of the filesystem
(e.g. changing imaxpct).  i.e. an old growfs should be able to
grow/shrink a thin filesystem correctly without being aware it is a
thin filesystem.

> If so, doesn't that mean we'd have two
> fields that are used to logically shrink the fs, depending on interface
> version, or that we'd have some kernels that logically shrink based on
> 'newblocks' and some that don't?

No.

> The larger question I have is what do we save by not just adding
> usable_blocks to growfs_data now so the interface remains
> self-explanatory? That seems relatively minor with respect to the
> on-disk changes.

We avoid having to modify an API for no real reason. We don't change
userspace APIs unless we have an actual need, and I'm not seeing
anyone articulate an actual need to change the growfs ioctl.

Further, changing the growfs API for thinspace filesystems means
that old growfs binaries will do bad things on thinspace filesystems
because growfs doesn't do version/feature checks. Hence we have to
make thinspace grow operations work sanely for existing
XFS_IOC_FSGEOMETRY_V4 callers, and that means we can't rely on a new
XFS_IOC_GROWFSDATA ioctl just to operate on thinspace filesystems.

*If* we add physical shrink support we can rev the growfs interface
at that point in time *if we need to*. But I'm simply not convinced
we will need to change it at all...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2017-11-01  0:45 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  8:33 [RFC PATCH 0/14] xfs: Towards thin provisioning aware filesystems Dave Chinner
2017-10-26  8:33 ` [PATCH 01/14] xfs: factor out AG header initialisation from growfs core Dave Chinner
2017-10-26  8:33 ` [PATCH 02/14] xfs: convert growfs AG header init to use buffer lists Dave Chinner
2017-10-26  8:33 ` [PATCH 03/14] xfs: factor ag btree reoot block initialisation Dave Chinner
2017-10-26  8:33 ` [PATCH 04/14] xfs: turn ag header initialisation into a table driven operation Dave Chinner
2017-10-26  8:33 ` [PATCH 05/14] xfs: make imaxpct changes in growfs separate Dave Chinner
2017-10-26  8:33 ` [PATCH 06/14] xfs: separate secondary sb update in growfs Dave Chinner
2017-10-26  8:33 ` [PATCH 07/14] xfs: rework secondary superblock updates " Dave Chinner
2017-10-26  8:33 ` [PATCH 08/14] xfs: move various type verifiers to common file Dave Chinner
2017-10-26  8:33 ` [PATCH 09/14] xfs: split usable space from block device size Dave Chinner
2017-10-26  8:33 ` [PATCH 10/14] xfs: hide reserved metadata space from users Dave Chinner
2017-10-26  8:33 ` [PATCH 11/14] xfs: bump XFS_IOC_FSGEOMETRY to v5 structures Dave Chinner
2017-10-26  8:33 ` [PATCH 12/14] xfs: convert remaingin xfs_sb_version_... checks to bool Dave Chinner
2017-10-26 16:03   ` Darrick J. Wong
2017-10-26  8:33 ` [PATCH 13/14] xfs: add suport for "thin space" filesystems Dave Chinner
2017-10-26  8:33 ` [PATCH 14/14] xfs: add growfs support for changing usable blocks Dave Chinner
2017-10-26 11:30   ` Amir Goldstein
2017-10-26 12:48     ` Dave Chinner
2017-10-26 13:32       ` Amir Goldstein
2017-10-27 10:26         ` Amir Goldstein
2017-10-26 11:09 ` [RFC PATCH 0/14] xfs: Towards thin provisioning aware filesystems Amir Goldstein
2017-10-26 12:35   ` Dave Chinner
2017-11-01 22:31     ` Darrick J. Wong
2017-10-30 13:31 ` Brian Foster
2017-10-30 21:09   ` Dave Chinner
2017-10-31  4:49     ` Amir Goldstein
2017-10-31 22:40       ` Dave Chinner
2017-10-31 11:24     ` Brian Foster
2017-11-01  0:45       ` Dave Chinner [this message]
2017-11-01 14:17         ` Brian Foster
2017-11-01 23:53           ` Dave Chinner
2017-11-02 11:25             ` Brian Foster
2017-11-02 23:30               ` Dave Chinner
2017-11-03  2:47                 ` Darrick J. Wong
2017-11-03 11:36                   ` Brian Foster
2017-11-05 22:50                     ` Dave Chinner
2017-11-06 13:01                       ` Brian Foster
2017-11-06 21:20                         ` Dave Chinner
2017-11-07 11:28                           ` Brian Foster
2017-11-03 11:26                 ` Brian Foster
2017-11-03 12:19                   ` Amir Goldstein
2017-11-06  1:16                     ` Dave Chinner
2017-11-06  9:48                       ` Amir Goldstein
2017-11-06 21:46                         ` Dave Chinner
2017-11-07  5:30                           ` Amir Goldstein
2017-11-05 23:51                   ` Dave Chinner
2017-11-06 13:07                     ` 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=20171101004513.GK5858@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).