public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Limit scope of extent locks in btrfs_buffered_write()
@ 2024-08-28 12:45 Goldwyn Rodrigues
  2024-08-28 12:45 ` [PATCH 1/2] btrfs: btrfs_has_ordered_extent() to check for ordered extent in range Goldwyn Rodrigues
  2024-08-28 12:45 ` [PATCH 2/2] btrfs: reduce scope of extent locks during buffered write Goldwyn Rodrigues
  0 siblings, 2 replies; 6+ messages in thread
From: Goldwyn Rodrigues @ 2024-08-28 12:45 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Goldwyn Rodrigues

From: Goldwyn Rodrigues <rgoldwyn@suse.com>

This is in preparation for using iomap for btrfs. It will help in
keeping the extent lock limited to iomap_end() function.

The extent locks are taken for a majority of the write sequence. With
Josef patches limiting the extent locks to recording extent changes, we
can reduce the scope of locking of extent locks during write to only
when recording the extent as delalloc. Restrict the locking to
btrfs_dirty_pages(). However, the write needs to make sure that there
are no pending ordered extents. So, wait for any pending ordered extents
before performing the copying of data from userspace.

As for testing, it did go through a round of xfstests without any crash
or failure. However, since this touches a crucial part of write, please
make sure this is correct especially in terms of data corruption by
overwrites/staleness.

Goldwyn Rodrigues (2):
  btrfs: btrfs_has_ordered_extent() to check for ordered extent in range
  btrfs: reduce scope of extent locks during buffered write

 fs/btrfs/file.c         | 109 ++++++----------------------------------
 fs/btrfs/ordered-data.c |  11 ++++
 fs/btrfs/ordered-data.h |   1 +
 3 files changed, 28 insertions(+), 93 deletions(-)

-- 
2.46.0


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

end of thread, other threads:[~2024-08-28 14:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 12:45 [PATCH 0/2] Limit scope of extent locks in btrfs_buffered_write() Goldwyn Rodrigues
2024-08-28 12:45 ` [PATCH 1/2] btrfs: btrfs_has_ordered_extent() to check for ordered extent in range Goldwyn Rodrigues
2024-08-28 13:28   ` Filipe Manana
2024-08-28 12:45 ` [PATCH 2/2] btrfs: reduce scope of extent locks during buffered write Goldwyn Rodrigues
2024-08-28 13:17   ` Filipe Manana
2024-08-28 14:21   ` Filipe Manana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox