When this mode is enabled, the chunk allocation policy is modified as
follows:
Each disk may have a different tag:
- BTRFS_DEV_ALLOCATION_PREFERRED_METADATA
- BTRFS_DEV_ALLOCATION_METADATA_ONLY
- BTRFS_DEV_ALLOCATION_DATA_ONLY
- BTRFS_DEV_ALLOCATION_PREFERRED_DATA (default)
Where:
- ALLOCATION_PREFERRED_X means that it is preferred to use this disk
for the X chunk type (the other type may be allowed when the space is
low)
- ALLOCATION_X_ONLY means that it is used *only* for the X chunk type.
This means also that it is a preferred choice.
Each time the allocator allocates a chunk of type X, first it takes the
disks tagged as ALLOCATION_X_ONLY or ALLOCATION_PREFERRED_X.
If the space is not enough, it uses also the disks tagged as
ALLOCATION_METADATA_ONLY.
If the space is not enough, it uses also the other disks, with the
exception of the one marked as ALLOCATION_PREFERRED_Y, where Y is the
other type of chunk (i.e. not X).
Mixed data and metadata block groups intentionally ignore all hints. They
cannot separate the two chunk classes and are outside the tiering use case
targeted by this feature.
The current type-based interface also has two known limitations: device
replace does not copy hints to the target device, and hint updates are not
serialized with concurrent chunk allocation.
v2:
- Document the mixed-block-group scope and the limitations of the
type-based interface.
Co-authored-by: Goffredo Baroncelli <kreijack@inwind.it> Signed-off-by: Kai Krakow <kai@kaishome.de>