btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

BTRFS Automatic BG Reclaim/Rebalance #13

Closed morbidrsa closed 2 years ago

morbidrsa commented 3 years ago

In HMZONED BTRFS each BG maps to one (or more) zones on the device. As we cannot do random I/O within a zone, only appends, it may happen after a lot of CoW operations in the BG that we run out of space due to this constraint.

To overcome this we should add the stale blocks to a “to reclaim” list and if more than a specific threshold of the BG is marked as stale, copy the uptodate blocks into a new BG or add them to free space in a more empty BG and free the old BG again to reset the zone(s).

As functionality may even be useful for non-HMZONED filesystems, it should be driven by a mount option.

morbidrsa commented 2 years ago

Merged with v5.13.