Skip to content

crimson/os/seastore: drop backrefs in cases of pure rbm seastores - #66740

Merged
Matan-B merged 3 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-rbm-no-backref
Jan 25, 2026
Merged

Matan-B merged 3 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-rbm-no-backref

Conversation

@xxhdx1985126

Copy link
Copy Markdown
Member

Signed-off-by: Xuehan Xu [email protected]

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test make check

@Matan-B Matan-B left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "Drop Backref tree concept on RBM Devices"

I think we should state somewhere (can_drop_backref definition?) that non-segmented devices do not rely on backward mapping (of logical addresses to physical ones) since its used only for GC.

Secondly, is the idea here to improve performance by dropping the backref tree maintaining operations? Or simply avoiding the redundant complexity of maintaining the additional tree?

auto scan_visitor = std::move(f);
co_await with_btree<LBABtree>(
cache, c,
seastar::coroutine::lambda{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

co_await LBABtree::iterate_repeat(
c,
btree.lower_bound(c, L_ADDR_MIN),
seastar::coroutine::lambda{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

DEBUGT("scan lba tree", t);
auto c = get_context(t);
auto scan_visitor = std::move(f);
co_await with_btree<LBABtree>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with_btree get the root node, construct the tree instance using the root and keep it safe with seastar::do_with. IIUC, we don't need this wrapper here anymore:

auto cache_root = co_await cache.get_root(c.trans);
auto btree = LBABtree(croot);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, a huge win of using coroutines is not needing helpers like with_btree which take a lambda.

[c, &scan_visitor, FNAME, this](auto &btree)
-> scan_mapped_space_ret {
auto block_size = cache.get_block_size();
co_await LBABtree::iterate_repeat(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to avoid the ertr repeat here and moving to a while loop (similarly to a02f6b0) the stop_iteration obj complicates the code IMO. However, in order to not stall this PR - we can follow up on this later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really prefer that this simply use a loop, shouldn't be too hard to update. Note, since we don't need with_btree, this would just be a loop in the top level coroutine.

@Matan-B Matan-B added this to Crimson Jan 1, 2026
@Matan-B Matan-B moved this to In Progress in Crimson Jan 1, 2026
ceph_assert(depth >= 1);
return scan_visitor(paddr, len, type, key);
};
co_await LBABtree::iterate_repeat(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too can probably just be a loop. We really want to avoid using the helpers when not necessary. (Unless I'm missing something LBABtree::iterate_repeat does?)

@athanatos athanatos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than my comments.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-rbm-no-backref branch from 3caf675 to d97d09e Compare January 16, 2026 10:22
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@Matan-B @athanatos Just modified the code as suggested, please take a look, again. Thanks:-)

@@ -487,9 +494,12 @@ class JournalTrimmer {
return get_journal_head_sequence() + 1 -
get_journal_tail().segment_seq;
}
protected:
bool tail_include_alloc = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please help me understand the new member? How is it related to the backref skipping?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At present, the journal contains two kinds of deltas: dirty modification deltas and space allocation deltas, the latter is used for modifying the backref tree. So, when the backref tree is no more, the corrresponding allocation deltas are not needed when calculating the journal tail. This field is an indicator about whether to include space allocation deltas when calculating the journal tail.

Comment on lines +1083 to +1084
// pure rbm
p_backend_type == backend_type_t::SEGMENTED || cold_sms);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this comment please?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the vague comment, it means this is a case when all the backends are RBM ones, will clarify it in the comment.

@@ -112,14 +112,17 @@ struct lba_map_val_t {
// laddr of a direct lba mapping(see btree_lba_manager.h)
extent_ref_count_t refcount = 0; ///< refcount
checksum_t checksum = 0; ///< checksum of original block written at paddr (TODO)
extent_types_t type = extent_types_t::NONE;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we let operator<< print the type?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any users of this member?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we let operator<< print the type?

Yeah, right.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-rbm-no-backref branch from d97d09e to 1116301 Compare January 19, 2026 02:39
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-rbm-no-backref branch from 1116301 to dac670a Compare January 19, 2026 02:45
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@Matan-B @athanatos Just modified the code to make it more clear, please take a look again, thanks:-)

@athanatos
athanatos self-requested a review January 23, 2026 01:19

@athanatos athanatos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Matan-B Matan-B moved this from In Progress to Needs QA in Crimson Jan 25, 2026
@Matan-B

Matan-B commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@xxhdx1985126

xxhdx1985126 commented Jan 25, 2026 •

Copy link
Copy Markdown
Member Author

@Matan-B
Matan-B merged commit 9c1a6fe into ceph:main Jan 25, 2026
@Matan-B Matan-B moved this from Needs QA to Merged (Main) in Crimson Jan 25, 2026
@Matan-B

Matan-B commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

@xxhdx1985126, do we have an estimate by any chance as to how much this affects perf?

NitzanMordhai pushed a commit to NitzanMordhai/ceph that referenced this pull request Jan 28, 2026
…ackref

crimson/os/seastore: drop backrefs in cases of pure rbm seastores

Reviewed-by: Samuel Just <[email protected]>
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@xxhdx1985126, do we have an estimate by any chance as to how much this affects perf?

Sorry, I missed this comment, will try to evaluate it:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

3 participants