From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH RFC 0/2] btrfs: defrag: further preparation for multi-page sector size
Date: Wed, 24 Jan 2024 14:29:06 +1030 [thread overview]
Message-ID: <cover.1706068026.git.wqu@suse.com> (raw)
With the folio interface, it's much easier to support multi-page sector
size (aka, sector/block size > PAGE_SIZE, which is rare between major
upstream filesystems).
The basic idea is, if we firstly convert to full folio interface, and
allow an address space to only allocate folio which is exactly
block/sector size, the support for multi-page would be mostly done.
But before that support, there are still quite some conversion left for
btrfs.
Furthermore, with both subpage and multipage sector size, we need to
handle folio different:
- For subpage
The folio would always be page sized.
- For multipage (and regular sectorsize == PAGE_SIZE)
The folio would be sector sized.
Furthermore, the filemap interface would make various shifts more
complex.
As filemap_*() interfaces use index which is PAGE_SHIFT based,
meanwhile with potential larger folio, the folio shift can be larger
than PAGE_SHIFT.
Thus in the future, we may want to change filemap interface to accept
bytenr to avoid confusion between page and folio shifts.
The first patch would introduce a cached folio size and shift.
The second patch would make defrag to utilize the new cached folio size
and shift.
(And still use PAGE_SHIFT only for filemap*() interfaces)
Qu Wenruo (2):
btrfs: introduce cached folio size
btrfs: defrag: prepare defrag for larger data folio size
fs/btrfs/defrag.c | 69 +++++++++++++++++++++++++---------------------
fs/btrfs/disk-io.c | 11 ++++++++
fs/btrfs/fs.h | 10 +++++++
3 files changed, 58 insertions(+), 32 deletions(-)
--
2.43.0
next reply other threads:[~2024-01-24 3:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 3:59 Qu Wenruo [this message]
2024-01-24 3:59 ` [PATCH RFC 1/2] btrfs: introduce cached folio size Qu Wenruo
2024-01-24 3:59 ` [PATCH RFC 2/2] btrfs: defrag: prepare defrag for larger data " Qu Wenruo
2024-02-15 20:23 ` Matthew Wilcox
2024-02-15 23:07 ` Qu Wenruo
2024-02-27 21:32 ` Matthew Wilcox
2024-02-27 21:42 ` Qu Wenruo
2024-01-24 4:03 ` [PATCH RFC 0/2] btrfs: defrag: further preparation for multi-page sector size Qu Wenruo
2024-01-24 4:48 ` Matthew Wilcox
2024-01-24 5:27 ` Qu Wenruo
2024-01-24 5:43 ` Matthew Wilcox
2024-01-24 5:50 ` Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1706068026.git.wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox