2022-05-13 16:54:14 +00:00
|
|
|
Subpage support
|
|
|
|
===============
|
|
|
|
|
|
|
|
Subpage block size support, or just *subpage* for short, is a feature to allow
|
|
|
|
using a filesystem that has different size of data block size (*sectorsize*)
|
|
|
|
and the host CPU page size. For easier implementation the support was limited
|
|
|
|
to the exactly same size of the block and page. On x86_64 this is typically
|
|
|
|
4KiB, but there are other architectures commonly used that make use of larger
|
2022-05-18 05:37:50 +00:00
|
|
|
pages, like 64KiB on 64bit ARM or PowerPC. This means filesystems created
|
|
|
|
with 64KiB sector size cannot be mounted on a system with 4KiB page size.
|
|
|
|
|
|
|
|
While with subpage support, systems with 64KiB page size can create (still needs
|
2023-05-31 23:14:47 +00:00
|
|
|
"-s 4k" option for :command:`mkfs.btrfs`) and mount filesystems with 4KiB sectorsize.
|
2022-05-18 05:37:50 +00:00
|
|
|
|
|
|
|
Requirements, limitations
|
2022-05-20 21:59:40 +00:00
|
|
|
-------------------------
|
2022-05-18 05:37:50 +00:00
|
|
|
|
|
|
|
The initial subpage support has been added in v5.15, although it's still
|
2023-05-31 23:14:47 +00:00
|
|
|
considered as experimental, most features are already working without problems.
|
2022-05-18 05:37:50 +00:00
|
|
|
|
|
|
|
End users can mount filesystems with 4KiB sectorsize and do their usual
|
|
|
|
workload, while should not notice any obvious change, as long as the initial
|
|
|
|
mount succeeded (there are cases a mount will be rejected though).
|
|
|
|
|
|
|
|
The following features has some limitations for subpage:
|
|
|
|
|
2023-05-31 23:14:47 +00:00
|
|
|
- Supported page sizes: 4KiB, 8KiB, 16KiB, 32KiB, 64KiB
|
2022-05-18 05:37:50 +00:00
|
|
|
|
2023-05-31 23:14:47 +00:00
|
|
|
- Supported filesystem sector sizes on a given host are exported in
|
|
|
|
:file:`/sys/fs/btrfs/features/supported_sectorsizes`
|
2022-05-18 05:37:50 +00:00
|
|
|
|
2023-05-31 23:14:47 +00:00
|
|
|
- No inline extents
|
2022-05-18 05:37:50 +00:00
|
|
|
|
2023-05-31 23:14:47 +00:00
|
|
|
This is an artificial limitation, to prevent mixed inline and regular extents.
|
2022-05-18 05:37:50 +00:00
|
|
|
|
2022-12-07 20:00:25 +00:00
|
|
|
Thus max_inline mount option will be silently ignored for subpage mounts,
|
2022-05-18 05:37:50 +00:00
|
|
|
and it always acts as "max_inline=0".
|
|
|
|
|
2023-05-31 23:14:47 +00:00
|
|
|
- Compression writes are limited to page aligned ranges
|
|
|
|
|
|
|
|
Compression write for subpage has been introduced in v5.16, with the
|
|
|
|
limitation that only page aligned range can be compressed. This limitation
|
|
|
|
is due to how btrfs handles delayed allocation.
|
2022-05-18 05:37:50 +00:00
|
|
|
|
|
|
|
- No support for v1 space cache
|
2023-05-31 23:14:47 +00:00
|
|
|
|
|
|
|
The old v1 cache has quite some hard coded page size usage, and considering
|
|
|
|
it already deprecated, we force v2 cache for subpage.
|