mbox series

[-next,v2,00/14] btrfs: Cleaned up folio->page conversion

Message ID 20240828182908.3735344-1-lizetao1@huawei.com (mailing list archive)
Headers show
Series btrfs: Cleaned up folio->page conversion | expand

Message

Li Zetao Aug. 28, 2024, 6:28 p.m. UTC
Hi all,

In btrfs, because there are some interfaces that do not use folio,
there is page-folio-page mutual conversion. This patch set should
clean up folio-page conversion as much as possible and use folio
directly to reduce invalid conversions.

This patch set starts with the rectification of function parameters,
using folio as parameters directly. And some of those functions have
already been converted to folio internally, so this part has little
impact. 

I have tested with fsstress more than 10 hours, and no problems were
found. For the convenience of reviewing, I try my best to only modify
a single interface in each patch.

Josef also worked on converting pages to folios, and this patch set was
inspired by him[1].

Considering Josef's suggestion[2], this patchset has passed most of the
xfs/btrfs use cases, include btrfs/060 and btrfs/069.

This patchset is based on commit bcdaf0fe6a52("btrfs: initialize
last_extent_end to fix -Wmaybe-uninitialized warning in extent_fiemap()")

v1 -> v2:
 * Change clear_page_extent_mapped() to clear_folio_extent_mapped()
 * Fix a bug[3] when folio is valid and it should be unlocked and put
 in copy_inline_to_page().

v1: https://lore.kernel.org/all/20240822013714.3278193-14-lizetao1@huawei.com/

[1]: https://lore.kernel.org/all/cover.1722022376.git.josef@toxicpanda.com/
[2]: https://lore.kernel.org/all/20240826140818.GA2393039@perftesting/
[3]: https://lore.kernel.org/all/20240822013714.3278193-15-lizetao1@huawei.com/

Thanks,
Li Zetao

Li Zetao (14):
  btrfs: convert clear_page_extent_mapped() to take a folio
  btrfs: convert get_next_extent_buffer() to take a folio
  btrfs: convert try_release_subpage_extent_buffer() to take a folio
  btrfs: convert try_release_extent_buffer() to take a folio
  btrfs: convert read_key_bytes() to take a folio
  btrfs: convert submit_eb_subpage() to take a folio
  btrfs: convert submit_eb_page() to take a folio
  btrfs: convert try_release_extent_state() to take a folio
  btrfs: convert try_release_extent_mapping() to take a folio
  btrfs: convert zlib_decompress() to take a folio
  btrfs: convert lzo_decompress() to take a folio
  btrfs: convert zstd_decompress() to take a folio
  btrfs: convert btrfs_decompress() to take a folio
  btrfs: convert copy_inline_to_page() to use folio

 fs/btrfs/compression.c | 14 +++----
 fs/btrfs/compression.h |  8 ++--
 fs/btrfs/disk-io.c     |  2 +-
 fs/btrfs/extent_io.c   | 92 ++++++++++++++++++++----------------------
 fs/btrfs/extent_io.h   |  6 +--
 fs/btrfs/inode.c       |  8 ++--
 fs/btrfs/lzo.c         | 12 +++---
 fs/btrfs/reflink.c     | 35 ++++++++--------
 fs/btrfs/verity.c      | 14 +++----
 fs/btrfs/zlib.c        | 14 +++----
 fs/btrfs/zstd.c        | 16 ++++----
 11 files changed, 109 insertions(+), 112 deletions(-)

Comments

David Sterba Aug. 29, 2024, 3:26 p.m. UTC | #1
On Thu, Aug 29, 2024 at 02:28:54AM +0800, Li Zetao wrote:
> Hi all,
> 
> In btrfs, because there are some interfaces that do not use folio,
> there is page-folio-page mutual conversion. This patch set should
> clean up folio-page conversion as much as possible and use folio
> directly to reduce invalid conversions.
> 
> This patch set starts with the rectification of function parameters,
> using folio as parameters directly. And some of those functions have
> already been converted to folio internally, so this part has little
> impact. 
> 
> I have tested with fsstress more than 10 hours, and no problems were
> found. For the convenience of reviewing, I try my best to only modify
> a single interface in each patch.
> 
> Josef also worked on converting pages to folios, and this patch set was
> inspired by him[1].
> 
> Considering Josef's suggestion[2], this patchset has passed most of the
> xfs/btrfs use cases, include btrfs/060 and btrfs/069.
> 
> This patchset is based on commit bcdaf0fe6a52("btrfs: initialize
> last_extent_end to fix -Wmaybe-uninitialized warning in extent_fiemap()")
> 
> v1 -> v2:
>  * Change clear_page_extent_mapped() to clear_folio_extent_mapped()
>  * Fix a bug[3] when folio is valid and it should be unlocked and put
>  in copy_inline_to_page().

I've tested the series a few times and so far no problems, the changes
are straightforward. I'll add it to for-next soon. Thanks.