RFC btrfs zoned block device support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest17 patches 19 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | btrfs: introduce HMZONED feature flagfs/ include/ | +3 | 0 replies | |
| 2/17 | btrfs: Get zone information of zoned block devicesfs/ fs/ | +178 | 1 reply | |
| 3/17 | btrfs: Check and enable HMZONED modefs/ fs/ fs/ +3 more | +112 | 3 replies | |
| 4/17 | btrfs: limit super block locations in HMZONED modefs/ | +9 | 0 replies | |
| 5/17 | btrfs: disable fallocate in HMZONED modefs/ | +4 | 0 replies | |
| 6/17 | btrfs: disable direct IO in HMZONED modefs/ | +3 | 0 replies | |
| 7/17 | btrfs: disable device replace in HMZONED modefs/ | +3 | 0 replies | |
| 8/17 | btrfs: align extent allocation to zone boundaryfs/ fs/ | +66 | 0 replies | |
| 9/17 | btrfs: do sequential allocation on HMZONED drivesfs/ fs/ fs/ +1 more | +299 | 0 replies | |
| 10/17 | btrfs: split btrfs_map_bio()fs/ | +31 | 0 replies | |
| 11/17 | btrfs: introduce submit bufferfs/ fs/ fs/ +1 more | +128 | 0 replies | |
| 12/17 | btrfs: expire submit buffer on timeoutfs/ fs/ fs/ +5 more | +136 | 0 replies | |
| 13/17 | btrfs: avoid sync IO prioritization on checksum in HMZONED modefs/ | +1 | 0 replies | |
| 14/17 | btrfs: redirty released extent buffers in sequential BGsfs/ fs/ fs/ +2 more | +58 | 0 replies | |
| 15/17 | btrfs: reset zones of unused block groupsfs/ | +21 | 0 replies | |
| 16/17 | btrfs: wait existing extents before truncatingfs/ | +11 | 0 replies | |
| 17/17 | btrfs: enable to mount HMZONED incompat flagfs/ | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 00/17] btrfs zoned block device support
This series adds zoned block device support to btrfs.
A zoned block device consists of a number of zones. Zones are either conventional and accepting random writes or sequential and requiring that writes be issued in LBA order from each zone write pointer position. This patch series ensures that the sequential write constraint of sequential zones is respected while fundamentally not changing BtrFS block and I/O management for block stored in conventional zones.
To achieve this, the default dev extent size of btrfs is changed on zoned block devices so that dev extents are always aligned to a zone. Allocation of blocks within a block group is changed so that the allocation is always sequential from the beginning of the block groups. To do so, an allocation pointer is added to block groups and used as the allocation hint. The allocation changes also ensures that block freed below the allocation pointer are ignored, resulting in sequential block allocation regardless of the block group usage.
While the introduction of the allocation pointer ensure that blocks will be allocated sequentially, I/Os to write out newly allocated blocks may be issued out of order, causing errors when writing to sequential zones. This problem s solved by introducing a submit_buffer() function and changes to the internal I/O scheduler to ensure in-order issuing of write I/Os for each chunk and corresponding to the block allocation order in the chunk.
The zones of a chunk are reset to allow reusing of the zone only when the block group is being freed, that is, when all the extents of the block group are unused.
For btrfs volumes composed of multiple zoned disks, restrictions are added to ensure that all disks have the same zone size. This matches the existing constraint that all dev extents in a chunk must have the same size.
It requires zoned block devices to test the patchset. Even if you don't have zone devices, you can use tcmu-runner [1] to emulate zoned block devices. It can export emulated zoned block devices via iSCSI. Please see the README.md of tcmu-runner [2] for howtos to generate a zoned block device on tcmu-runner.
[1] https://github.com/open-iscsi/tcmu-runner
[2] https://github.com/open-iscsi/tcmu-runner/blob/master/README.md
Patch 1 introduces the HMZONED incompatible feature flag to indicate that the btrfs volume was formatted for use on zoned block devices.
Patches 2 and 3 implement functions to gather information on the zones of the device (zones type and write pointer position).
Patch 4 restrict the possible locations of super blocks to conventional zones to preserve the existing update in-place mechanism for the super blocks.
Patches 5 to 7 disable features which are not compatible with the sequential write constraints of zoned block devices. This includes fallocate and direct I/O support. Device replace is also disabled for now.
Patches 8 and 9 tweak the extent buffer allocation for HMZONED mode to implement sequential block allocation in block groups and chunks.
Patches 10 to 12 implement the new submit buffer I/O path to ensure sequential write I/O delivery to the device zones.
Patches 13 to 16 modify several parts of btrfs to handle free blocks without breaking the sequential block allocation and sequential write order as well as zone reset for unused chunks.
Finally, patch 17 adds the HMZONED feature to the list of supported features.
Naohiro Aota (17):
btrfs: introduce HMZONED feature flag
btrfs: Get zone information of zoned block devices
btrfs: Check and enable HMZONED mode
btrfs: limit super block locations in HMZONED mode
btrfs: disable fallocate in HMZONED mode
btrfs: disable direct IO in HMZONED mode
btrfs: disable device replace in HMZONED mode
btrfs: align extent allocation to zone boundary
btrfs: do sequential allocation on HMZONED drives
btrfs: split btrfs_map_bio()
btrfs: introduce submit buffer
btrfs: expire submit buffer on timeout
btrfs: avoid sync IO prioritization on checksum in HMZONED mode
btrfs: redirty released extent buffers in sequential BGs
btrfs: reset zones of unused block groups
btrfs: wait existing extents before truncating
btrfs: enable to mount HMZONED incompat flag
fs/btrfs/async-thread.c | 1 + fs/btrfs/async-thread.h | 1 + fs/btrfs/ctree.h | 36 ++- fs/btrfs/dev-replace.c | 10 + fs/btrfs/disk-io.c | 48 +++- fs/btrfs/extent-tree.c | 281 +++++++++++++++++- fs/btrfs/extent_io.c | 1 + fs/btrfs/extent_io.h | 1 + fs/btrfs/file.c | 4 + fs/btrfs/free-space-cache.c | 36 +++ fs/btrfs/free-space-cache.h | 10 + fs/btrfs/inode.c | 14 + fs/btrfs/super.c | 32 ++- fs/btrfs/sysfs.c | 2 + fs/btrfs/transaction.c | 32 +++ fs/btrfs/transaction.h | 3 + fs/btrfs/volumes.c | 551 ++++++++++++++++++++++++++++++++++-- fs/btrfs/volumes.h | 37 +++ include/uapi/linux/btrfs.h | 1 + 19 files changed, 1061 insertions(+), 40 deletions(-)
Signature · 1 line
2.18.0