From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-btrfs@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH 0/2] Reduce scope of extent locking while reading
Date: Mon, 19 Aug 2024 16:00:51 -0400 [thread overview]
Message-ID: <cover.1724095925.git.rgoldwyn@suse.com> (raw)
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
Extent locking is not required for the entire read process. Once the
extent map is read all information to retrieve is available in the
extent map, and is cached in em_cached for later retrieval. The extent
map cached is also refcounted so it would not disappear.
Limit the extent locking while reading the extnet maps only. The rest is
just creating bio and fetching/decompressing the data according to the
extent map provided.
The only reason this was not working is because we would get EIO as
the CRCs would not match (or were not committed to disk as yet) for
folios that were written and released. In order to get over it, mark the
extent as finished only after all folios are cleared of writeback.
I have run the xfstests on it without any deadlocks or corruptions.
However, a fresh outlook on what could go wrong with a limiting the
scope of locks would be good.
Goldwyn Rodrigues (2):
btrfs: clear folio writeback after completing ordered range
btrfs: take extent lock only while reading extent map
fs/btrfs/compression.c | 5 ---
fs/btrfs/extent_io.c | 99 +++---------------------------------------
2 files changed, 7 insertions(+), 97 deletions(-)
--
2.46.0
next reply other threads:[~2024-08-19 20:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 20:00 Goldwyn Rodrigues [this message]
2024-08-19 20:00 ` [PATCH 1/2] btrfs: clear folio writeback after completing ordered range Goldwyn Rodrigues
2024-08-19 20:00 ` [PATCH 2/2] btrfs: take extent lock only while reading extent map Goldwyn Rodrigues
2024-08-29 17:53 ` [PATCH 0/2] Reduce scope of extent locking while reading David Sterba
2024-08-29 21:59 ` Goldwyn Rodrigues
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.1724095925.git.rgoldwyn@suse.com \
--to=rgoldwyn@suse.de \
--cc=linux-btrfs@vger.kernel.org \
--cc=rgoldwyn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.