public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Anton Mitterer <calestyo@scientia.org>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/2] btrfs: defrag: better lone extent handling
Date: Tue, 06 Feb 2024 21:27:58 +0100	[thread overview]
Message-ID: <9fc5dddc8831842ddde40a93bb0ac018a700993a.camel@scientia.org> (raw)
In-Reply-To: <cover.1707172743.git.wqu@suse.com>

Hey.

From an admin PoV, I wonder whether this (i.e. doing it via defrag) is
the (only) desired approach to this problem.


defrag always sounds like a manual intervention on a degrading
filesystem, which for an admin is always rater undesirable than
desirable.
(questions like: How often needs on to run it? What are the best
settings? Does it impact the regular system IO? ...)


Your patches to btrfs-progs, would that allow one to defrag *only* the
extents with the cut-off?
I mean from an admin-PoV I may want to fix that - but not defrag all
other files, which may involve quite some reading/writing?


Would it technically even be possible, to fix (= shrink by rewriting)
the extent right at the time when the userspace truncates it?
I mean has btrfs even a chance to notice it at that point ("oops, we've
just wasted n MB, shall we do something about it right, or wait for the
user to manually defrag?").

Feels a bit like a mount option where one could say if a truncate
causes more than n bytes to be lost, re-write instantaneously.

*If* that would even be possible, it doesn't mean that the defrag way
couldn't be beneficial, too.
Some people may rather want to waste the space first, and only clean up
later, when IO is less busy.



Cheers,
Chris.

      parent reply	other threads:[~2024-02-06 20:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 23:45 [PATCH 0/2] btrfs: defrag: better lone extent handling Qu Wenruo
2024-02-05 23:45 ` [PATCH 1/2] btrfs: defrag: add under utilized extent to defrag target list Qu Wenruo
2024-02-06 16:23   ` Filipe Manana
2024-02-06 20:41     ` Qu Wenruo
2024-02-06 22:26       ` Qu Wenruo
2024-02-07 12:19       ` Filipe Manana
2024-02-05 23:45 ` [PATCH 2/2] btrfs: defrag: allow fine-tuning on lone extent defrag behavior Qu Wenruo
2024-02-06 17:03   ` Filipe Manana
2024-02-06 20:50     ` Qu Wenruo
2024-02-07 12:27       ` Filipe Manana
2024-02-07 17:40         ` Christoph Anton Mitterer
2024-02-06 20:27 ` Christoph Anton Mitterer [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=9fc5dddc8831842ddde40a93bb0ac018a700993a.camel@scientia.org \
    --to=calestyo@scientia.org \
    --cc=linux-btrfs@vger.kernel.org \
    --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