Project

General

Profile

Actions

Bug #62815

closed
IF IF

hybrid/avl allocators might be very ineffective when serving bluefs allocations

Bug #62815: hybrid/avl allocators might be very ineffective when serving bluefs allocations

Added by Igor Fedotov about 3 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

100%

Source:
Community (dev)
Backport:
reef, quincy, pacific
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Fixed In:
v19.0.0-109-g553bb23df7c
Released In:
v19.2.0~1091
Upkeep Timestamp:
2025-07-11T22:08:47+00:00

Description

When operating in best-fit mode these allocators perform chunk lookups through size-sorted "range_size_tree" container. This is done in two stages:

Use container's lower_bound() to search for the first available
long enough chunk.
Iterate sequentially to locate properly aligned chunk,
starting from the position obtained at step 1)
Step 2) might require significant efforts for bluefs allocations (which uses longer allocation unit than bluestore min_alloc_size, e.g. 64K vs. 4K) if space is highly fragmented. Plenty of potentially available chunks might be unaligned to 64K boundary and once aligned they aren't long enough any more.

This spreadsheet shows how dramatic could that be for hybrid allocator (real free map from a production cluster was used to build it):
https://docs.google.com/spreadsheets/d/1bh22JNqwTPSFUQPStYuuiKDEui6YSxZsusIln3tZ9t0/edit?usp=sharing


Related issues 4 (0 open — 4 closed)

Is duplicate of bluestore - Bug #62509: os/bluestore: suspect performance bottleneck on allocatorDuplicate

Actions
Copied to bluestore - Backport #63760: reef: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolvedIgor Fedotov

Actions
Copied to bluestore - Backport #63761: quincy: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolved

Actions
Copied to bluestore - Backport #63762: pacific: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolvedIgor Fedotov

Actions

IF Updated by Igor Fedotov about 3 years ago Actions #1

Actually the above description is valid for both best- and fast-fit modes. Sequential lookup for 64K aligned chunk might be pretty costly. I've made an experiment where the alignment requirement was changed from 64K to 4K. And allocation times dropped dramatically.
Looks like a good fix to me as large chunk alignment requirement is apparently redundant.

IF Updated by Igor Fedotov about 3 years ago Actions #2

Originally the issue was revealed a while ago when the following PR was made: https://github.com/ceph/ceph/pull/48640

That implementation is rather an overkill though since we might just get rid off the alignment requirement instead.

IF Updated by Igor Fedotov about 3 years ago Actions #3

  • Severity changed from 3 - minor to 2 - major

IF Updated by Igor Fedotov about 3 years ago Actions #4

  • Pull request ID set to 53483

IF Updated by Igor Fedotov about 3 years ago Actions #5

  • Backport set to reef, quincy, pacific

IF Updated by Igor Fedotov about 3 years ago Actions #6

  • Status changed from New to Fix Under Review

IF Updated by Igor Fedotov about 3 years ago Actions #7

  • Is duplicate of Bug #62509: os/bluestore: suspect performance bottleneck on allocator added

IF Updated by Igor Fedotov about 3 years ago Actions #8

  • Status changed from Fix Under Review to Duplicate

IF Updated by Igor Fedotov about 3 years ago Actions #9

  • Status changed from Duplicate to Fix Under Review

YW Updated by Yuri Weinstein almost 3 years ago Actions #11

  • Target version set to v18.2.1

merged

IF Updated by Igor Fedotov almost 3 years ago Actions #13

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot almost 3 years ago Actions #14

  • Copied to Backport #63760: reef: hybrid/avl allocators might be very ineffective when serving bluefs allocations added

UB Updated by Upkeep Bot almost 3 years ago Actions #15

  • Copied to Backport #63761: quincy: hybrid/avl allocators might be very ineffective when serving bluefs allocations added

UB Updated by Upkeep Bot almost 3 years ago Actions #16

  • Copied to Backport #63762: pacific: hybrid/avl allocators might be very ineffective when serving bluefs allocations added

ID Updated by Ilya Dryomov almost 3 years ago Actions #18

  • Target version deleted (v18.2.1)

IF Updated by Igor Fedotov over 2 years ago Actions #20

  • Status changed from Pending Backport to Resolved

KS Updated by Konstantin Shalygin over 2 years ago Actions #21

  • Assignee set to Igor Fedotov
  • % Done changed from 0 to 100
  • Source set to Community (dev)

UB Updated by Upkeep Bot over 1 year ago Actions #22

  • Merge Commit set to 553bb23df7cb4554a79845b6f15ee582c71e32db
  • Fixed In set to v19.0.0-109-g553bb23df7c
  • Released In set to v19.2.0~1091
  • Upkeep Timestamp set to 2025-07-11T22:08:47+00:00
Actions

Also available in: PDF Atom