All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Reduce scope of extent locking while reading
@ 2024-08-19 20:00 Goldwyn Rodrigues
  2024-08-19 20:00 ` [PATCH 1/2] btrfs: clear folio writeback after completing ordered range Goldwyn Rodrigues
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Goldwyn Rodrigues @ 2024-08-19 20:00 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goldwyn Rodrigues

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-29 21:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 20:00 [PATCH 0/2] Reduce scope of extent locking while reading Goldwyn Rodrigues
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

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.