public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs: preparation patches for the incoming metadata folio conversion
@ 2023-07-11  7:49 Qu Wenruo
  2023-07-11  7:49 ` [PATCH 1/6] btrfs: tests: enhance extent buffer bitmap tests Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Qu Wenruo @ 2023-07-11  7:49 UTC (permalink / raw)
  To: linux-btrfs

[BACKGROUND]

Recently I'm checking on the feasibility on converting metadata handling
to go a folio based solution.

The best part of using a single folio for metadata is, we can get rid of
the complexity of cross-page handling, everything would be just a single
memory operation on a continuous memory range.

[PITFALLS]

One of the biggest problem for metadata folio conversion is, we still
need the current page based solution (or folios with order 0) as a
fallback solution when we can not get a high order folio.

In that case, there would be a hell to handle the four different
combinations (folio/folio, folio/page, page/folio, page/page) for extent
buffer helpers involving two extent buffers.

[OBJECTIVE]

So this patchset is the preparation to reduce direct page operations for
metadata.

The patchset would do this mostly be concentrate the operations to use
the common helper, write_extent_buffer() and read_extent_buffer().

For bitmap operations it's much complex, thus this patchset refactor it
completely to go a 3 part solution:

- Handle the first byte
- Handle the byte aligned ranges
- Handle the last byte

This needs more complex testing (which I failed several times during
development) to prevent regression.

Finally there is only one function which can not be properly migrated,
memmove_extent_buffer(), which has to use memmove() calls, thus must go
per-page mapping handling.

Thankfully if we go folio in the end, the folio based handling would
just be a single memmove(), thus it won't be too much burden.

Qu Wenruo (6):
  btrfs: tests: enhance extent buffer bitmap tests
  btrfs: refactor extent buffer bitmaps operations
  btrfs: use write_extent_buffer() to implement
    write_extent_buffer_*id()
  btrfs: refactor memcpy_extent_buffer()
  btrfs: refactor copy_extent_buffer_full()
  btrfs: call copy_extent_buffer_full() inside
    btrfs_clone_extent_buffer()

 fs/btrfs/extent_io.c             | 219 ++++++++++++++-----------------
 fs/btrfs/tests/extent-io-tests.c | 161 +++++++++++++++--------
 2 files changed, 204 insertions(+), 176 deletions(-)

-- 
2.41.0


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

end of thread, other threads:[~2023-07-11 22:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-11  7:49 [PATCH 0/6] btrfs: preparation patches for the incoming metadata folio conversion Qu Wenruo
2023-07-11  7:49 ` [PATCH 1/6] btrfs: tests: enhance extent buffer bitmap tests Qu Wenruo
2023-07-11  7:49 ` [PATCH 2/6] btrfs: refactor extent buffer bitmaps operations Qu Wenruo
2023-07-11  7:49 ` [PATCH 3/6] btrfs: use write_extent_buffer() to implement write_extent_buffer_*id() Qu Wenruo
2023-07-11 17:02   ` Sweet Tea Dorminy
2023-07-11 22:43     ` Qu Wenruo
2023-07-11  7:49 ` [PATCH 4/6] btrfs: refactor memcpy_extent_buffer() Qu Wenruo
2023-07-11  7:49 ` [PATCH 5/6] btrfs: refactor copy_extent_buffer_full() Qu Wenruo
2023-07-11  7:49 ` [PATCH 6/6] btrfs: call copy_extent_buffer_full() inside btrfs_clone_extent_buffer() Qu Wenruo

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