public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/7] Btrfs: defrag: the remaining unmerged part
Date: Thu, 24 Feb 2022 20:28:34 +0800	[thread overview]
Message-ID: <cover.1645705266.git.wqu@suse.com> (raw)

David has already rebased all bug fixes into his fix/autodefrag-io
branch.
(Although the last patch still lacks one line to make it work).

This patchset is the remaining related cleanups.

If the 2nd patch doesn't apply, it means the patch "trfs:
reduce extent threshold for autodefrag" is not correct, and doesn't
apply extent_thresh properly.

The first patch removes one unused parameter.
The second patch makes __btrfs_run_defrag_inode() to meet our current
standard.

Patch 3~6 re-introduce the btrfs_defrag_ctrl to cleanup the argument
lists, and make btrfs_defrag_file() reports accurate sectors_defragged.

The last patch introduces the needed trace events.
With the trace events, it's much easier to verify the defrag behavior,
and provide a user-friendly way to debug defrag bugs.

Originally I used those trace events to verfy the reduced extent_thresh
for autodefrag, but I found out a better way to verify the behavior
without using trace events.

So I'll send a new test case to check the changed autodefrag behavior.

Qu Wenruo (7):
  btrfs: remove unused parameter for btrfs_add_inode_defrag()
  btrfs: refactor __btrfs_run_defrag_inode()
  btrfs: uapi: introduce BTRFS_DEFRAG_RANGE_MASK for later sanity check
  btrfs: defrag: introduce btrfs_defrag_ctrl structure for later usage
  btrfs: defrag: use btrfs_defrag_ctrl to replace
    btrfs_ioctl_defrag_range_args for btrfs_defrag_file()
  btrfs: defrag: make btrfs_defrag_file() to report accurate number of
    defragged sectors
  btrfs: add trace events for defrag

 fs/btrfs/ctree.h             |  25 +++-
 fs/btrfs/file.c              |  92 +++++++--------
 fs/btrfs/inode.c             |   2 +-
 fs/btrfs/ioctl.c             | 213 ++++++++++++++++++-----------------
 include/trace/events/btrfs.h | 127 +++++++++++++++++++++
 include/uapi/linux/btrfs.h   |   6 +-
 6 files changed, 310 insertions(+), 155 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-02-24 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 12:28 Qu Wenruo [this message]
2022-02-24 12:28 ` [PATCH 1/7] btrfs: remove unused parameter for btrfs_add_inode_defrag() Qu Wenruo
2022-02-24 12:28 ` [PATCH 2/7] btrfs: refactor __btrfs_run_defrag_inode() Qu Wenruo
2022-02-24 12:28 ` [PATCH 3/7] btrfs: uapi: introduce BTRFS_DEFRAG_RANGE_MASK for later sanity check Qu Wenruo
2022-02-24 12:28 ` [PATCH 4/7] btrfs: defrag: introduce btrfs_defrag_ctrl structure for later usage Qu Wenruo
2022-02-24 12:28 ` [PATCH 5/7] btrfs: defrag: use btrfs_defrag_ctrl to replace btrfs_ioctl_defrag_range_args for btrfs_defrag_file() Qu Wenruo
2022-02-24 12:28 ` [PATCH 6/7] btrfs: defrag: make btrfs_defrag_file() to report accurate number of defragged sectors Qu Wenruo
2022-02-24 12:28 ` [PATCH 7/7] btrfs: add trace events 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.1645705266.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