[PATCH v2 0/7] btrfs: convert some struct page users to folios

Tal Zussman posted 7 patches 2 weeks, 4 days ago
fs/btrfs/compression.c           |  20 +++---
fs/btrfs/tests/extent-io-tests.c | 131 +++++++++++++++++++++------------------
fs/btrfs/volumes.c               |  16 +++--
fs/btrfs/zoned.c                 |  12 ++--
4 files changed, 93 insertions(+), 86 deletions(-)
[PATCH v2 0/7] btrfs: convert some struct page users to folios
Posted by Tal Zussman 2 weeks, 4 days ago
This series converts three areas of btrfs that still use struct page:

1. The extent-io tests. test_find_delalloc() uses the page APIs, and the
   extent buffer memory checks assume one page per folio.

2. Compression. btrfs_compr_pool_scan() walks the folio pool as struct
   page, the last use of page->lru in btrfs, and the heuristic sampler
   is the last caller of find_get_page().

3. Super block reads. btrfs_read_disk_super() and the zoned super block
   log comparison are the last page cache lookups by page in btrfs.

Tested with KASAN, lockdep, DEBUG_VM and the btrfs selftests enabled.
xfstests' compress group under compress=zstd and the btrfs group both
pass.

---
Changes in v2:
- Add tags (Thanks Qu!)
- Patch 2: Assert that test_find_delalloc()'s folios are order-0, per Qu
- Drop the v1 free space cache patches (8-10), per Qu. The v1 space
  cache will be removed instead
- Link to v1: https://patch.msgid.link/20260906-btrfs-folio-conversions-v1-0-834b9d7b06f5@columbia.edu

---
Tal Zussman (7):
      btrfs: tests: rename process_page_range() to process_folio_range()
      btrfs: tests: convert test_find_delalloc() to use folios
      btrfs: tests: use eb folio helpers in extent buffer memory checks
      btrfs: convert btrfs_compr_pool_scan() to use folios
      btrfs: convert heuristic_collect_sample() to use folios
      btrfs: fix stale function references in compression comments
      btrfs: use folios for reading super blocks from the block device

 fs/btrfs/compression.c           |  20 +++---
 fs/btrfs/tests/extent-io-tests.c | 131 +++++++++++++++++++++------------------
 fs/btrfs/volumes.c               |  16 +++--
 fs/btrfs/zoned.c                 |  12 ++--
 4 files changed, 93 insertions(+), 86 deletions(-)
---
base-commit: 69b26c13e520480d1869171e2c2b8a59f0c857ec
change-id: 20260905-btrfs-folio-conversions-47950cc1faca

Best regards,
--  
Tal Zussman <tz2294@columbia.edu>
Re: [PATCH v2 0/7] btrfs: convert some struct page users to folios
Posted by Qu Wenruo 2 weeks, 2 days ago

在 2026/9/8 05:49, Tal Zussman 写道:
> This series converts three areas of btrfs that still use struct page:
> 
> 1. The extent-io tests. test_find_delalloc() uses the page APIs, and the
>     extent buffer memory checks assume one page per folio.
> 
> 2. Compression. btrfs_compr_pool_scan() walks the folio pool as struct
>     page, the last use of page->lru in btrfs, and the heuristic sampler
>     is the last caller of find_get_page().
> 
> 3. Super block reads. btrfs_read_disk_super() and the zoned super block
>     log comparison are the last page cache lookups by page in btrfs.
> 
> Tested with KASAN, lockdep, DEBUG_VM and the btrfs selftests enabled.
> xfstests' compress group under compress=zstd and the btrfs group both
> pass.

Now pushed to for-next branch.

Thanks,
Qu

> 
> ---
> Changes in v2:
> - Add tags (Thanks Qu!)
> - Patch 2: Assert that test_find_delalloc()'s folios are order-0, per Qu
> - Drop the v1 free space cache patches (8-10), per Qu. The v1 space
>    cache will be removed instead
> - Link to v1: https://patch.msgid.link/20260906-btrfs-folio-conversions-v1-0-834b9d7b06f5@columbia.edu
> 
> ---
> Tal Zussman (7):
>        btrfs: tests: rename process_page_range() to process_folio_range()
>        btrfs: tests: convert test_find_delalloc() to use folios
>        btrfs: tests: use eb folio helpers in extent buffer memory checks
>        btrfs: convert btrfs_compr_pool_scan() to use folios
>        btrfs: convert heuristic_collect_sample() to use folios
>        btrfs: fix stale function references in compression comments
>        btrfs: use folios for reading super blocks from the block device
> 
>   fs/btrfs/compression.c           |  20 +++---
>   fs/btrfs/tests/extent-io-tests.c | 131 +++++++++++++++++++++------------------
>   fs/btrfs/volumes.c               |  16 +++--
>   fs/btrfs/zoned.c                 |  12 ++--
>   4 files changed, 93 insertions(+), 86 deletions(-)
> ---
> base-commit: 69b26c13e520480d1869171e2c2b8a59f0c857ec
> change-id: 20260905-btrfs-folio-conversions-47950cc1faca
> 
> Best regards,
> --
> Tal Zussman <tz2294@columbia.edu>

Re: [PATCH v2 0/7] btrfs: convert some struct page users to folios
Posted by David Sterba 2 weeks, 2 days ago
On Wed, Sep 09, 2026 at 03:40:47PM +0930, Qu Wenruo wrote:
> 
> 
> 在 2026/9/8 05:49, Tal Zussman 写道:
> > This series converts three areas of btrfs that still use struct page:
> > 
> > 1. The extent-io tests. test_find_delalloc() uses the page APIs, and the
> >     extent buffer memory checks assume one page per folio.
> > 
> > 2. Compression. btrfs_compr_pool_scan() walks the folio pool as struct
> >     page, the last use of page->lru in btrfs, and the heuristic sampler
> >     is the last caller of find_get_page().
> > 
> > 3. Super block reads. btrfs_read_disk_super() and the zoned super block
> >     log comparison are the last page cache lookups by page in btrfs.
> > 
> > Tested with KASAN, lockdep, DEBUG_VM and the btrfs selftests enabled.
> > xfstests' compress group under compress=zstd and the btrfs group both
> > pass.
> 
> Now pushed to for-next branch.

Tal, please send the cast removal I asked for in patch 5 separately. Thanks.
Re: [PATCH v2 0/7] btrfs: convert some struct page users to folios
Posted by Tal Zussman 2 weeks, 2 days ago
On 9/9/26 5:03 PM, David Sterba wrote:
> On Wed, Sep 09, 2026 at 03:40:47PM +0930, Qu Wenruo wrote:
>> 
>> 
>> 在 2026/9/8 05:49, Tal Zussman 写道:
>> > This series converts three areas of btrfs that still use struct page:
>> > 
>> > 1. The extent-io tests. test_find_delalloc() uses the page APIs, and the
>> >     extent buffer memory checks assume one page per folio.
>> > 
>> > 2. Compression. btrfs_compr_pool_scan() walks the folio pool as struct
>> >     page, the last use of page->lru in btrfs, and the heuristic sampler
>> >     is the last caller of find_get_page().
>> > 
>> > 3. Super block reads. btrfs_read_disk_super() and the zoned super block
>> >     log comparison are the last page cache lookups by page in btrfs.
>> > 
>> > Tested with KASAN, lockdep, DEBUG_VM and the btrfs selftests enabled.
>> > xfstests' compress group under compress=zstd and the btrfs group both
>> > pass.
>> 
>> Now pushed to for-next branch.
> 
> Tal, please send the cast removal I asked for in patch 5 separately. Thanks.
> 

Done: https://lore.kernel.org/linux-btrfs/20260909-btrfs-heuristic-u64-index-v1-1-8606b3c89807@columbia.edu/T/#u