linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Why use thin_pool_autoextend_threshold < 100 ?
Date: Tue, 31 Jul 2018 20:43:38 -0600	[thread overview]
Message-ID: <CAJCQCtS4iWKOybMmoVjHSbO2d3PSsZxHsb9hf-V1Fh0s2gxGkg@mail.gmail.com> (raw)
In-Reply-To: <23393.3545.410050.534764@quad.stoffel.home>

On Tue, Jul 31, 2018 at 7:33 PM, John Stoffel <john@stoffel.org> wrote:
>>>>>> "Chris" == Chris Murphy <lists@colorremedies.com> writes:
>
> Chris> On Fri, Jul 27, 2018 at 1:31 PM, John Stoffel <john@stoffel.org> wrote:
>>>
>>> Why don't you run quotas on your filesystems?  Also, none of the
>>> filesystems in Linux land that I'm aware of supports shrinking the
>>> filesystem while live, it's all a unmount, shrink FS, shrink volume
>>> (carefully!) and then re-mount the filesystem.
>
> Chris> Btrfs supports grow and shrink resizes only when mounted. It's
> Chris> not possible to resize when unmounted.
>
> That's... bizarre.  Good to know, but bizarre.  That does make it more
> appealing to use in day to day situations for sure.  Any thoughts on
> how stable this is in real life?

I've never heard of it failing in many years of being on the Btrfs
list. The resize leverages the same block group handling as balance
code, so the relocation of block groups during resize is the same as
you'd get with a filtered balance, it's integral to the file system's
operation.

The shrink operation first moves block groups in the region subject to
shrink (the part that's going away), and this is an atomic operation
per block group. You could pull the plug on it (and I have) in
progress and you'd just get a reversion to a prior state before the
last file system metadata and superblock commit (assumes the hardware
isn't lying and some hardware does lie). Once all the block groups are
moved, and the dev and chunk trees are updated to reflect the new
location of those chunks (block groups), the superblocks are updated
to reflect the new device size.

Literally the shrink operation changes very little metadata, it's just
moving block groups, and then the actual "resize" is merely a
superblock change. The file system metadata doesn't change much
because Btrfs uses an internal logical block addressing to reference
file extents and those references stay the same during a resize. The
logical block range mapping to physical block range mapping is a tiny
update (maybe 1/2 dozen 16K leaf and node writes) and those updates
are always COW, not overwrites. That's also how this is an atomic
operation. If the block group copy fails, the dev and chunk trees that
are used to translate between logical and physical block ranges never
get updated.


-- 
Chris Murphy

  reply	other threads:[~2018-08-01  2:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 16:31 [linux-lvm] Why use thin_pool_autoextend_threshold < 100 ? Marc MERLIN
2018-07-27 12:59 ` Zdenek Kabelac
2018-07-27 18:26   ` Marc MERLIN
2018-07-27 19:31     ` John Stoffel
2018-07-27 19:58       ` Marc MERLIN
2018-07-27 21:09         ` John Stoffel
2018-07-27 23:35           ` Marc MERLIN
2018-07-31  4:52       ` Chris Murphy
2018-08-01  1:33         ` John Stoffel
2018-08-01  2:43           ` Chris Murphy [this message]
2018-08-02 17:42             ` Chris Murphy
2018-07-31  2:44     ` Marc MERLIN
2018-07-31 12:35       ` Zdenek Kabelac
2018-07-31 21:17         ` Marc MERLIN
2018-08-01 11:37           ` Zdenek Kabelac

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=CAJCQCtS4iWKOybMmoVjHSbO2d3PSsZxHsb9hf-V1Fh0s2gxGkg@mail.gmail.com \
    --to=lists@colorremedies.com \
    --cc=linux-lvm@redhat.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;
as well as URLs for NNTP newsgroup(s).