| From: |
| Johannes Thumshirn <jth-AT-kernel.org> |
| To: |
| Chris Mason <clm-AT-fb.com>, Josef Bacik <josef-AT-toxicpanda.com>, David Sterba <dsterba-AT-suse.com> |
| Subject: |
| [PATCH v5 0/3] btrfs: zoned: always set aside a zone for relocation |
| Date: |
| Fri, 24 May 2024 18:29:08 +0200 |
| Message-ID: |
| <20240524-zoned-gc-v5-0-872907c7cff4@kernel.org> |
| Cc: |
| Hans Holmberg <Hans.Holmberg-AT-wdc.com>, linux-btrfs-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Naohiro Aota <naohiro.aota-AT-wdc.com>, Filipe Manana <fdmanana-AT-suse.com>, Johannes Thumshirn <johannes.thumshirn-AT-wdc.com> |
| Archive-link: |
| Article |
For zoned filesytsems we heavily rely on relocation for garbage collecting
as we cannot do any in-place updates of disk blocks.
But there can be situations where we're running out of space for doing the
relocation.
To solve this, always have a zone reserved for relocation.
This is a subset of another approach to this problem I've submitted in
https://lore.kernel.org/r/20240328-hans-v1-0-4cd558959407...
---
Changes in v5:
- Split out one patch to skip relocation of the data relocation bg
- Link to v4: https://lore.kernel.org/r/20240523-zoned-gc-v4-0-23ed9f61...
Changes in v4:
- Skip data_reloc_bg in delete_unused_bgs() and reclaim_bgs_work()
- Link to v3: https://lore.kernel.org/r/20240521-zoned-gc-v3-0-7db97424...
Changes in v3:
- Rename btrfs_reserve_relocation_zone -> btrfs_reserve_relocation_bg
- Bail out if we already have a relocation bg set
- Link to v2: https://lore.kernel.org/r/20240515-zoned-gc-v2-0-20c7cb97...
Changes in v2:
- Incorporate Naohiro's review
- Link to v1: https://lore.kernel.org/r/20240514-zoned-gc-v1-0-109f1a6c...
---
Johannes Thumshirn (3):
btrfs: don't try to relocate the data relocation block-group
btrfs: zoned: reserve relocation block-group on mount
btrfs: reserve new relocation block-group after successful relocation
fs/btrfs/block-group.c | 11 ++++++++
fs/btrfs/disk-io.c | 2 ++
fs/btrfs/relocation.c | 14 +++++++++++
fs/btrfs/volumes.c | 2 ++
fs/btrfs/zoned.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
fs/btrfs/zoned.h | 3 +++
6 files changed, 100 insertions(+)
---
base-commit: 2aabf192868a0f6d9ee3e35f9b0a8d97c77a46da
change-id: 20240514-zoned-gc-2ce793459eb7
Best regards,
--
Johannes Thumshirn <jth@kernel.org>