btrfs-progs
btrfs-progs copied to clipboard
Clarify read performance note
The btrfs readthedocs, which is sourced from this repository, says the following at this link:
"The simple redundancy RAID levels utilize different mirrors in a way that does not achieve the maximum performance. The logic can be improved so the reads will spread over the mirrors evenly or based on device congestion."
Where is this logic? What can be improved about it? Is this suggesting that, in current kernels, reads on a RAID1 filesystem go directly to the same disk, every time, rather than being distributed between the 2? Is this statement out-of-date?
See find_live_mirror
in fs/btrfs/volumes.c
. There is a read policy framework which would allow defining better read policies, but to date only one has been implemented: the PID policy, which assigns threads to devices based on PID.
You can read about an earlier attempt from 2021 here and here. The alternative policies were dropped due to various issues.