Skip to content

btrfs: read_policy types latency, device and round-robin

Anand Jain linux-btrfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 10 repliesIn review
  2. v34 patches 10 repliesSuperseded
  3. v24 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches11 repliesSuperseded

Changes in v4 from the cover letter

Add rb from Josef in patch 1 and 3.
In patch 1/3, use fs_info instead of device->fs_devices->fs_info. Drop round-robin policy because my workload (fio random) shows no performance
gains due to fewer merges at the block layer.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: add read_policy latencyfs/btrfs/sysfs.c fs/btrfs/volumes.c fs/btrfs/volumes.h+42 -18 replies
2/3btrfs: introduce new device-state read_preferredfs/btrfs/sysfs.c fs/btrfs/volumes.h+54 -01 reply
3/3btrfs: introduce new read_policy devicefs/btrfs/sysfs.c fs/btrfs/volumes.c fs/btrfs/volumes.h+26 -10 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchJosef Bacik
1/3R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] btrfs: read_policy types latency, device and round-robin

v4:
Add rb from Josef in patch 1 and 3.
In patch 1/3, use fs_info instead of device->fs_devices->fs_info. Drop round-robin policy because my workload (fio random) shows no performance
gains due to fewer merges at the block layer.

v3:
The block layer commit 0d02129e76ed (block: merge struct block_device and struct hd_struct) has changed the first argument in the function part_stat_read_all() in 5.11-rc1. So trickle down its changes in the patch 1/4.

v2:
Fixes as per review comments, as in the individual patches.

rfc->v1:
Drop the tracing patch.
Drop the factor associated with the inflight commands (because there were too many unnecessary switches).
Few C styles fix.

-----

This patchset adds read policy types latency, device, and round-robin, for the mirrored raid profiles such as raid1, raid1c3, raid1c4, and raid10. The default read policy remains as PID, as of now.

Read policy types:
Latency:

Latency policy routes the read IO based on the historical average wait time experienced by the read IOs on the individual device.

Device:

With the device policy along with the read_preferred flag, you can set the device for reading manually. Useful to test mirrors in a deterministic way and helps advance system administrations.

Round-robin (RFC patch):

Alternates striped device in a round-robin loop for reading. To achieve this first we put the stripes in an array, sort it by devid and pick the next device.

Test scripts:
=============

I have included a few scripts which were useful for testing.

-------------------8<-------------------------------- Set latency policy on the btrfs mounted at /mnt

Usage example:

  $ readpolicyset /mnt latency

Anand Jain (3):
btrfs: add read_policy latency
btrfs: introduce new device-state read_preferred
btrfs: introduce new read_policy device

 fs/btrfs/sysfs.c   | 57 ++++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/volumes.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/volumes.h |  5 ++++
 3 files changed, 121 insertions(+), 1 deletion(-)
Signature · 1 line
2.28.0