public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/9] btrfs: more optimizations for lseek and fiemap
Date: Fri, 11 Nov 2022 11:50:26 +0000	[thread overview]
Message-ID: <cover.1668166764.git.fdmanana@suse.com> (raw)

From: Filipe Manana <fdmanana@suse.com>

Here follows a few more optimizations for lseek and fiemap. Starting with
coreutils 9.0, cp no longer uses fiemap to determine where holes are in a
file, instead it uses lseek's SEEK_HOLE and SEEK_DATA modes of operation.
For very sparse files, or files with lot of delalloc, this can be very
slow (when compared to ext4 or xfs). This aims to improve that.

The cp pattern is not specific to cp, it's common to iterate over all
allocated regions of a file sequentially with SEEK_HOLE and SEEK_DATA,
for either the whole file or just a section. Another popular program that
does the same is tar, when using its --sparse / -S command line option
(I use it like that for doing vm backups for example).

The details are in the changelogs of each patch, and results are on the
changelog of the last patch in the series. There's still much more room
for further improvement, but that won't happen too soon as it will require
broader changes outside the lseek and fiemap code.

Filipe Manana (9):
  btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree
  btrfs: add an early exit when searching for delalloc range for lseek/fiemap
  btrfs: skip unnecessary delalloc searches during lseek/fiemap
  btrfs: search for delalloc more efficiently during lseek/fiemap
  btrfs: remove no longer used btrfs_next_extent_map()
  btrfs: allow passing a cached state record to count_range_bits()
  btrfs: update stale comment for count_range_bits()
  btrfs: use cached state when looking for delalloc ranges with fiemap
  btrfs: use cached state when looking for delalloc ranges with lseek

 fs/btrfs/ctree.h          |   1 +
 fs/btrfs/extent-io-tree.c |  73 +++++++++++--
 fs/btrfs/extent-io-tree.h |  10 +-
 fs/btrfs/extent_io.c      |  30 +++---
 fs/btrfs/extent_map.c     |  29 -----
 fs/btrfs/extent_map.h     |   2 -
 fs/btrfs/file.c           | 221 ++++++++++++++++++--------------------
 fs/btrfs/file.h           |   1 +
 fs/btrfs/inode.c          |   2 +-
 9 files changed, 190 insertions(+), 179 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-11-11 11:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 11:50 fdmanana [this message]
2022-11-11 11:50 ` [PATCH 1/9] btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree fdmanana
2022-11-11 11:50 ` [PATCH 2/9] btrfs: add an early exit when searching for delalloc range for lseek/fiemap fdmanana
2022-11-11 11:50 ` [PATCH 3/9] btrfs: skip unnecessary delalloc searches during lseek/fiemap fdmanana
2022-11-11 11:50 ` [PATCH 4/9] btrfs: search for delalloc more efficiently " fdmanana
2022-11-11 11:50 ` [PATCH 5/9] btrfs: remove no longer used btrfs_next_extent_map() fdmanana
2022-11-11 11:50 ` [PATCH 6/9] btrfs: allow passing a cached state record to count_range_bits() fdmanana
2022-11-11 11:50 ` [PATCH 7/9] btrfs: update stale comment for count_range_bits() fdmanana
2022-11-11 11:50 ` [PATCH 8/9] btrfs: use cached state when looking for delalloc ranges with fiemap fdmanana
2022-11-11 11:50 ` [PATCH 9/9] btrfs: use cached state when looking for delalloc ranges with lseek fdmanana
2022-11-11 19:12 ` [PATCH 0/9] btrfs: more optimizations for lseek and fiemap David Sterba
2022-11-12  1:44 ` Wang Yugui
2022-12-13  9:11 ` Naohiro Aota
2022-12-13 10:39   ` Filipe Manana
2022-12-16  6:53     ` Naohiro Aota
2023-01-23  2:13       ` Naohiro Aota

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.1668166764.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --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