Skip to content

crimson/os/seastore: realize lazy read in split overwrite with overwrite refactor - #51179

Merged
cyx1231st merged 10 commits into
ceph:mainfrom
aisakaki:wip-lazy-read-r2
Jul 7, 2023
Merged

cyx1231st merged 10 commits into
ceph:mainfrom
aisakaki:wip-lazy-read-r2

Conversation

@aisakaki

@aisakaki aisakaki commented Apr 23, 2023 •

Copy link
Copy Markdown
Contributor

this PR:

  1. Partially Implement lazy read for split overwrite.
    This is the first PR for fully split overwrite lazy read implementation.
    This PR reduce once read when remapping an extent, but there is an another redundant read in original logic for the same extent before remapping in unaligned scenario, so this pr just bring a 38.1% improvement for comprehensive performance in overwrite for now.
    The solution is to split left/right extent to small prepend extent before overwrite.
    I am working on this and will realize this in next PR.
  2. Refactor overwrite according to the discussion.
    Separate remap, insert, retire logic in overwrite.
    Separate remapping in multiple extents and remapping in one extent for new transaction manager interface remap_pin and overwrite_pin.

test

no performance regression in other situation.

The same test config as #45519
rand write to full image:

branch IOPS BW
main 3234 12.6MiB/s
split with lazy-read 4457 17.4MiB/s
Improved about 38.1%.

*updated test result of latest push

Contribution Guidelines

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

@aisakaki
aisakaki requested a review from a team as a code owner April 23, 2023 02:16
@cyx1231st

Copy link
Copy Markdown
Member

@myoungwon this is the overwrite PR I referred in #50419

Also see the original discussion in #45519 (comment)

@cyx1231st
cyx1231st requested a review from myoungwon April 23, 2023 02:27
@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch 3 times, most recently from d53fdad to 33e82ea Compare April 23, 2023 04:06
@myoungwon

Copy link
Copy Markdown
Member

@myoungwon this is the overwrite PR I referred in #50419

Also see the original discussion in #45519 (comment)

Thanks. I'll take a close look at this.

@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.

1/n.

These comments should apply to the shared part of #50421 as well.

Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/root_block.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cached_extent.h Outdated
length = this->ptr->length();
}

/// no buffer extent, for lazy read

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.

(Irrelavent to this PR) Looks RetiredExtentPlaceholder can be simplifed and be merged with the lazy read feature.

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.

Perhaps the extent state in this case would be CLEAN_INCOMPLETE.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes indeed, will do this later.

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.

Perhaps the extent state in this case would be CLEAN_INCOMPLETE.

Probably not worthing it after a second thought, because we should also introduce CLEAN_EXISTING_INCOMPLETE in that case.

Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved

@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.

The direction makes sense to me!

The overall suggestions are:

  • Use the unambiguous names such as original/remap/overwrite paddr/laddr/len
  • Do deep copy to bl/bptr only when necessary, the only case seems to be at the duplicate-for-write time.

Fixing the readability issues is necessary for the next round of review.

@aisakaki

Copy link
Copy Markdown
Contributor Author

The direction makes sense to me!

The overall suggestions are:

  • Use the unambiguous names such as original/remap/overwrite paddr/laddr/len
  • Do deep copy to bl/bptr only when necessary, the only case seems to be at the duplicate-for-write time.

Fixing the readability issues is necessary for the next round of review.

Thanks for review, I will solve these issues soon!

@myoungwon

Copy link
Copy Markdown
Member

Sorry, my review might be slow due to Ceph deduplication paper work which has been accepted by USENIX ATC'23.

@aisakaki

aisakaki commented May 3, 2023

Copy link
Copy Markdown
Contributor Author

Sorry, my review might be slow due to Ceph deduplication paper work which has been accepted by USENIX ATC'23.

thanks, it doesn't matter~

@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch 2 times, most recently from 84d79a8 to 2d8ef7c Compare May 6, 2023 12:04
@aisakaki

aisakaki commented May 8, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions

github-actions Bot commented May 9, 2023

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch from 26eb69b to 22f65c0 Compare May 16, 2023 09:10
@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch from 22f65c0 to 7ba5aed Compare May 26, 2023 08:09
@aisakaki

Copy link
Copy Markdown
Contributor Author

@cyx1231st refactor finished~

@aisakaki
aisakaki requested a review from cyx1231st June 30, 2023 01:59
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
separate buffer length and data length, since no buffer extent is allowed

Signed-off-by: Xinyu Huang <[email protected]>
@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch from 535f5f8 to 55af3be Compare July 3, 2023 09:52
@aisakaki

aisakaki commented Jul 3, 2023

Copy link
Copy Markdown
Contributor Author

@cyx1231st all addressed~

@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch 3 times, most recently from cab6925 to 9e67286 Compare July 4, 2023 01:26
@aisakaki

aisakaki commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test docs

@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.

LGTM except for the comments

Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
Comment thread src/crimson/os/seastore/cache.h Resolved
@cyx1231st
cyx1231st requested a review from athanatos July 4, 2023 08:44
@aisakaki
aisakaki force-pushed the wip-lazy-read-r2 branch from 9e67286 to 9d973ef Compare July 4, 2023 09:07
@aisakaki

aisakaki commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test api

@cyx1231st

Copy link
Copy Markdown
Member

jenkins test docs

@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.

Seems reasonable to me!

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.

6 participants