Skip to content

btrfs: basic tier support

wangyugui linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4btrfs: add tier score to devicefs/btrfs/volumes.c fs/btrfs/volumes.h+23 -00 replies
2/4btrfs: tiering data and metadatafs/btrfs/ctree.h fs/btrfs/super.c fs/btrfs/volumes.c+167 -20 replies
3/4btrfs: tier-aware mirror path selectfs/btrfs/volumes.c+20 -10 replies
4/4btrfs: tier-aware free space caclfs/btrfs/super.c+18 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] btrfs: basic tier support

Storage tier is a big feature, this is just a basic support.

1) Add tier score to device
We use a single score value to define the tier level of a device. Different score means different tier, and bigger score is faster.
DAX device(dax=1)
SSD device(rotational=0)
HDD device(rotational=1)
TODO/FIXME: FIXME: detect bus(DIMM, NVMe, SCSI, SATA, Virtio, ...) TODO/FIXME: user-assigned property(refactoring the coming 'read_preferred' property?) to
set to the max score for some not-well-supported case.

In most case, only 1 or 2 tiers are used at the same time, so we group them into top tier and other tier(s).

2) tiering data and metadata
This based the patch 'btrfs: add ssd_metadata mode' from Goffredo Baroncelli <[email protected]>

We define a mount option to tiering data/metadata to slower/faster device(s) When there is only 1 tier, tiering is auto disabled.

mount option: tier[={off|auto|data_tier_X/metadata_tier_Y}] default is 'tier[=auto]'. 'tier' is same as 'tier=auto', 'tier=OF/TF' the policies to use the device(s):

    Top-tier-Only(TO)       : metadata only use top-tier device.
    Top-tier-Firstly(TF)    : metadata use top-tier device firstly.
    Other-tier-First(OF)    : data use other-tier device firstly.
    Other-tier-Only(OO)     : data only use other-tier device.

data_tier_X is the policy for data, support OF, OO. metadata_tier_Y is the policy for metadata and system, support TF.

3) tier-aware mirror path select
This feature help the read performance, so it is enabled even if tier=off.

4) tier-aware free space cacl
Detect some case of free space 0 because of tier policy of data. Full support is yet TODO/FIXME.

5) TODO/FIXME: per-subvol tiering policy and then per-subvol profile(RAID)
per-subvol tiering policy and then per-subvol data profile(RAID) is needed for the full tier support.
data policy support TO, TF too, in addition to OF, OO.
But now as a workaround, we can keep them as 2 separated btrfs file system with disk partition and 'btrfs filesystem resize'.

wangyugui (4):
btrfs: add tier score to device
btrfs: tiering data and metadata
btrfs: tier-aware mirror path select
btrfs: tier-aware free space cacl

 fs/btrfs/ctree.h   |  17 +++++++
 fs/btrfs/super.c   |  90 ++++++++++++++++++++++++++++++++++
 fs/btrfs/volumes.c | 119 +++++++++++++++++++++++++++++++++++++++++++--
 fs/btrfs/volumes.h |   5 ++
 4 files changed, 228 insertions(+), 3 deletions(-)
Signature · 1 line
2.29.1