Skip to content

btrfs: Speedup chunk allocation for large fs

Qu Wenruo linux-btrfs 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Fix the false ENOSPC __btrfs_alloc_chunk() return caused by unhandled search_hint value
- Rebase to misc-next to co-operate with seed device related code
- Add reviewed-by tags for the first patch

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: Don't search devid for every verify_one_dev_extent() callfs/btrfs/volumes.c+18 -120 replies
2/2btrfs: Introduce free dev extent hint to speed up chunk allocationfs/btrfs/volumes.c fs/btrfs/volumes.h+83 -30 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchNikolay BorisovAnand Jain
1/2R-b R-b
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] btrfs: Speedup chunk allocation for large fs

This patchset can be fetched from github:
https://github.com/adam900710/linux/tree/falloc_speedup

Which is based on misc-next branch, with the following commit as base:
commit eb3e579e28f1c58e79176fbf5afe1cf3ee227190

Author: Anand Jain <[email protected]>
Date:   Fri Feb 8 15:39:37 2019 +0800

btrfs: fix comment its device list mutex not volume lock

Btrfs falloc can be slower and slower when there are more and more block groups.

One cause of this problem is find_free_dev_extent(), as it always search from device offset 0, and if there are thousands existing dev extents btrfs will search leaf by leaf until it reaches a free slot.

This is super slow and inefficient.

This patchset will introduce a new member, btrfs_device::hint_free_dev_extent to give some hint for find_free_dev_extent().

The full cause analyse and benchmark can be found in the 2nd patch.

Changelog:
v2:
- Fix the false ENOSPC __btrfs_alloc_chunk() return caused by unhandled search_hint value
- Rebase to misc-next to co-operate with seed device related code
- Add reviewed-by tags for the first patch

Qu Wenruo (2):
btrfs: Don't search devid for every verify_one_dev_extent() call
btrfs: Introduce free dev extent hint to speed up chunk allocation

 fs/btrfs/volumes.c | 58 ++++++++++++++++++++++++++++++++++------------
 fs/btrfs/volumes.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+), 15 deletions(-)
Signature · 1 line
2.20.1