Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 0/2] btrfs-progs: cmds/filesystem: add --usage-ratio and --wasted-bytes options
Date: Tue, 12 Mar 2024 14:27:29 +1030	[thread overview]
Message-ID: <cover.1710214834.git.wqu@suse.com> (raw)

[CHANGELOG]
v2:
- Sync the newer kernel uapi
- Remove the "lone" mentions
  Now the new options would be "--usage-ratio" and "--wasted-bytes".

This the progs support for the new kernel defrag parameters.

This adds 2 new fine tunning parameters, --usage-ratio and
--wasted-bytes.

The ratio is between [0, 100] (aka, percentage value), and wasted bytes
is between [0, U32_MAX], but in reality the value only makes sense below
max file extent size (for both compressed and regular extents).
Any value higher than max file extent size would mostly disable the
wasted bytes check (as it would always be false).

The default usage ratio is 5%, and 16MiB wasted bytes.
If the kernel doesn't support the new options, it would fall back to
the old ioctl flags without the 2 new flags.

Qu Wenruo (2):
  btrfs-progs: defrag: sync the usage ratio/wasted bytes fine-tunning
    from kernel
  btrfs-progs: cmds/filesystem: add --usage-ratio and --wasted-bytes for
    defrag

 Documentation/btrfs-filesystem.rst | 21 ++++++++++++
 cmds/filesystem.c                  | 53 ++++++++++++++++++++++++++++--
 kernel-shared/uapi/btrfs.h         | 39 ++++++++++++++++++++--
 3 files changed, 107 insertions(+), 6 deletions(-)

--
2.44.0


             reply	other threads:[~2024-03-12  3:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12  3:57 Qu Wenruo [this message]
2024-03-12  3:57 ` [PATCH v2 1/2] btrfs-progs: defrag: sync the usage ratio/wasted bytes fine-tunning from kernel Qu Wenruo
2024-03-12  3:57 ` [PATCH v2 2/2] btrfs-progs: cmds/filesystem: add --usage-ratio and --wasted-bytes for defrag Qu Wenruo

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=cover.1710214834.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@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