Skip to content

crimson/os/seastore/lba_manager: do batch mapping allocs when remapping multiple mappings - #57818

Merged
cyx1231st merged 2 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-lba-remap-perf-opt
Jun 17, 2024
Merged

cyx1231st merged 2 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-lba-remap-perf-opt

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@xxhdx1985126
xxhdx1985126 marked this pull request as ready for review June 2, 2024 08:25
@xxhdx1985126
xxhdx1985126 requested a review from a team as a code owner June 2, 2024 08:25
@xxhdx1985126
xxhdx1985126 requested a review from cyx1231st June 2, 2024 08:37
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-lba-remap-perf-opt branch from 821f9ec to 38d771d Compare June 2, 2024 08:40

@cyx1231st cyx1231st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Still looking.

Seems it is an intermediate step towards the direction to "iterate the lba-tree in one lookup to do update and insertions, or to do multiple removes".

In other words, I think when doing object data write (with the overwrite() implementations), the involved mappings (to update or insert) will be continuous.

If I'm correct above, the first commit of this PR (non-continuous mappings) will be finally deprecated, right?

@xxhdx1985126

xxhdx1985126 commented Jun 3, 2024 •

Copy link
Copy Markdown
Member Author

If I'm correct above, the first commit of this PR (non-continuous mappings) will be finally deprecated, right?

If iterating the lba-tree in one lookup to do update and insertions, or to do multiple removes turns out to be feasible, Yes. And all current modification interfaces of LBAManager will be deprecated, too.

Actually, we are trying to take 2 steps towards this goal:

  1. implement "alloc_extents", "remove_mappings", "update_mappings", "move_mappings" and "clone_mappings", all of which are to do multiple same-type operations with one lba lookup;
  2. implement the "batch-modify" approach.

If the second step is not feasible, we have "batch-same-type-modify" ability at least.

@xxhdx1985126

xxhdx1985126 commented Jun 3, 2024 •

Copy link
Copy Markdown
Member Author

There's another use case for the non-continuous extents allocation:

At present, when doing clone/clone_range, we do two ObjectDataHandler::clone_extents() and one ObjectDataHandler::do_removals() to make the refcount of intermediate mappings correct. This is inefficient, we can do one move_mappings which move direct mappings to a new laddr space and one ObjectDataHandler::clone_extents. Since the mappings to be moved may not be continuous, we need the non-continuous extents allocation ability from LBAManager, so that the moves can be done with one lba lookup.

Meanwhile, OSDs' out-of-order recovery of clone objects also needs the move_mappings function

@cyx1231st

cyx1231st commented Jun 4, 2024 •

Copy link
Copy Markdown
Member

Yeah, I think it's OK if the direction is aligned.

(unrelated to this PR below)

implement "alloc_extents", "remove_mappings", "update_mappings", "move_mappings" and "clone_mappings", all of which are to do multiple same-type operations with one lba lookup;

Seems to me a dedicated "move_mappings" interface for user (ObjectDataHandler) might not be finally necessary, because it is always associated with a follow-up cloning. Probably the "LBA::clone_mappings" can hide&handle it internally when the "to-clone" mapping is direct. Merging "move_mappings" into "clone_mappings" also enables the optimization to directly set the ref-counter to 2 without another iteration of lookups.

Still, it should be fine to be in another step.

Since the mappings to be moved may not be continuous, we need the non-continuous extents allocation ability from LBAManager, so that the moves can be done with one lba lookup.

Meanwhile, OSDs' out-of-order recovery of clone objects also needs the move_mappings function

Ack, makes sense.

@xxhdx1985126

Copy link
Copy Markdown
Member Author

Yeah, I think it's OK if the direction is aligned.

(unrelated to this PR below)

implement "alloc_extents", "remove_mappings", "update_mappings", "move_mappings" and "clone_mappings", all of which are to do multiple same-type operations with one lba lookup;

Seems to me a dedicated "move_mappings" interface for user (ObjectDataHandler) might not be finally necessary, because it is always associated with a follow-up cloning. Probably the "LBA::clone_mappings" can hide&handle it internally when the "to-clone" mapping is direct. Merging "move_mappings" into "clone_mappings" also enables the optimization to directly set the ref-counter to 2 without another iteration of lookups.

Still, it should be fine to be in another step.

Yeah, we'll try to merge it into clone_mappings:-)

Since the mappings to be moved may not be continuous, we need the non-continuous extents allocation ability from LBAManager, so that the moves can be done with one lba lookup.

Meanwhile, OSDs' out-of-order recovery of clone objects also needs the move_mappings function

Ack, makes sense.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-lba-remap-perf-opt branch 2 times, most recently from 4583da2 to 9aa93ce Compare June 4, 2024 03:19

@cyx1231st cyx1231st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Otherwise LGTM.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-lba-remap-perf-opt branch from 9aa93ce to 5ddf098 Compare June 4, 2024 09:53

@cyx1231st cyx1231st left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggest some semantic revises, the implementation looks good.

non-continuous extents as long as it doesn't violate the order of lba
keys

Signed-off-by: Xuehan Xu <[email protected]>
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-lba-remap-perf-opt branch from 5ddf098 to 28efb51 Compare June 6, 2024 12:27
@xxhdx1985126

Copy link
Copy Markdown
Member Author

All done.

@cyx1231st

Copy link
Copy Markdown
Member

jenkins retest this please

@cyx1231st

Copy link
Copy Markdown
Member

jenkins test windows

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants