public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/9] btrfs: remove ASSERT()s for folio_order() and folio_test_large()
@ 2025-03-17  7:10 Qu Wenruo
  2025-03-17  7:10 ` [PATCH v3 1/9] btrfs: send: remove the again label inside put_file_data() Qu Wenruo
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Qu Wenruo @ 2025-03-17  7:10 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v3:
- Prepare btrfs_end_repair_bio() to support larger folios
  Unfortunately folio_iter structure is way too large compared to
  bvec_iter, thus it's not a good idea to convert bbio::saved_iter to
  folio_iter.

  Thankfully it's not that complex to grab the folio from a bio_vec.

- Add a new patch to prepare defrag for larger data folios

v2:
- Update the commit message for the first patch

There are quite some ASSERT()s checking folio_order() or
folio_test_large() on data folios.

They are the blockage for the incoming larger data folios.

This series will remove most of them, with the following exceptions
which are not a blockage for larger data folios.

- wait_dev_supers() and write_dev_supers()
  They are folios from block device cache, will not be affected by our
  larger data folios support.

- relocation_one_folio()
  It's about data relocation inode, and we can disable larger data folios
  for such special inode easily.

- btrfs_attach_subpage()
  The folio_test_large() is only for metadata, just change it to be a
  metadata specific check.

The first patch is just a small cleanup for send, exposed during the
removal of ASSERT()s.

The conversion for defrag is only tested to not break the existing
subpage and regular cases.
The full tests can only be done with larger data folios support enabled.

Although there is one real blockage before enabling larger data folios:

- btrfs_buffered_write()
  Currnetly we always reserved space first, then grab the folio.
  This makes it impossible to support variable sized folios.

  We have to align the behavior to iomap, which grab the folio first
  then determine the reserved space according to the folio size.

  This will touch the core function of btrfs and can not be hidden
  behind experimental flags.
  Thus that change will be a dedicated one and needs a lot of
  reviews/tests.

Qu Wenruo (9):
  btrfs: send: remove the again label inside put_file_data()
  btrfs: send: prepare put_file_data() for larger data folios
  btrfs: prepare btrfs_page_mkwrite() for larger data folios
  btrfs: prepare prepare_one_folio() for larger data folios
  btrfs: prepare end_bbio_data_write() for larger data folios
  btrfs: subpage: prepare for larger data folios
  btrfs: zlib: prepare copy_data_into_buffer() for larger data folios
  btrfs: prepare btrfs_end_repair_bio() for larger data folios
  btrfs: enable larger data folios support for defrag

 fs/btrfs/bio.c       | 28 ++++++++++++-----
 fs/btrfs/defrag.c    | 72 ++++++++++++++++++++++++++------------------
 fs/btrfs/extent_io.c |  3 --
 fs/btrfs/file.c      |  6 +---
 fs/btrfs/send.c      | 29 ++++++++----------
 fs/btrfs/subpage.c   |  6 ++--
 fs/btrfs/zlib.c      |  2 --
 7 files changed, 79 insertions(+), 67 deletions(-)

-- 
2.48.1


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

end of thread, other threads:[~2025-04-07  7:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17  7:10 [PATCH v3 0/9] btrfs: remove ASSERT()s for folio_order() and folio_test_large() Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 1/9] btrfs: send: remove the again label inside put_file_data() Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 2/9] btrfs: send: prepare put_file_data() for larger data folios Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 3/9] btrfs: prepare btrfs_page_mkwrite() " Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 4/9] btrfs: prepare prepare_one_folio() " Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 5/9] btrfs: prepare end_bbio_data_write() " Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 6/9] btrfs: subpage: prepare " Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 7/9] btrfs: zlib: prepare copy_data_into_buffer() " Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 8/9] btrfs: prepare btrfs_end_repair_bio() " Qu Wenruo
2025-04-03 19:56   ` David Sterba
2025-04-06 23:19   ` Qu Wenruo
2025-04-07  6:18   ` Christoph Hellwig
2025-04-07  7:11     ` Qu Wenruo
2025-03-17  7:10 ` [PATCH v3 9/9] btrfs: enable larger data folios support for defrag Qu Wenruo
2025-03-17 13:55 ` [PATCH v3 0/9] btrfs: remove ASSERT()s for folio_order() and folio_test_large() David Sterba
2025-03-17 15:13   ` David Sterba
2025-03-31  4:47     ` Qu Wenruo
2025-04-03 19:54       ` David Sterba
2025-04-03 21:45         ` Qu Wenruo

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