Skip to content

crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent#53501

Merged
cyx1231st merged 1 commit intoceph:mainfrom
zhscn:wip-lba-backref-node-size
Sep 21, 2023
Merged

crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent#53501
cyx1231st merged 1 commit intoceph:mainfrom
zhscn:wip-lba-backref-node-size

Conversation

@zhscn
Copy link
Member

@zhscn zhscn commented Sep 18, 2023

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

@zhscn zhscn requested a review from a team as a code owner September 18, 2023 11:38
@cyx1231st
Copy link
Member

cyx1231st commented Sep 19, 2023

Probably it's more reasonable make the copy constructor of CachedExtent to be page aligned (not 8 byte aligned) in this case, instead of increasing the node sizes to 8KB ?

@cyx1231st cyx1231st requested a review from athanatos September 19, 2023 04:56
@zhscn
Copy link
Member Author

zhscn commented Sep 19, 2023

Probably it's more reasonable make the copy constructor of CachedExtent to be page aligned (not 8 byte aligned) in this case, instead of increasing the node sizes to 8KB ?

Yeah, you are right, I'll repush it.

@zhscn zhscn force-pushed the wip-lba-backref-node-size branch from 6d65cf6 to ebd15e6 Compare September 19, 2023 06:17
@zhscn zhscn changed the title crimson/os/seastore: update BACKREF_BLOCK_SIZE and LBA_BLOCK_SIZE to 8KiB crimson/os/seastore: create page aligned bufferptr in copy ctor of CachedExtent Sep 19, 2023
@@ -708,8 +708,8 @@ class CachedExtent
version(other.version),
poffset(other.poffset) {
if (other.is_fully_loaded()) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's add an assert to make sure the target length is already page-aligned before calling buffer::create_page_aligned(length).

(I don't see how this is possible right now) Otherwise, I think the allocation should fall back to the unaligned way to save memory.

Copy link
Member Author

@zhscn zhscn Sep 20, 2023

Choose a reason for hiding this comment

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

https://github.com/ceph/seastar/blob/50c6790df3db6ab38b5fea7e03494828dc2aafdc/src/core/memory.cc#L1430L1434

The allocator of seastar only guarantees alignment for power-of-two allocations. Currently, all types of extent length satisfy this limitation except for ObjectDataBlock. Seems we should take some methods to avoid this overhead.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the input!

Looks the power-of-two strategy is only applied when the allocation is smaller than a page: size <= max_small_allocation && align <= page_size, so ObjectDataBlock isn't actually impacted here, right?

Copy link
Member Author

@zhscn zhscn Sep 20, 2023

Choose a reason for hiding this comment

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

max_small_allocation here is 128KB, so if the length of client data is not power-of-two aligned or one 4K overwrite to an existing 128KB ObjectDataBlock, it might produce a new power-of-two not aligned ObjectDataBlock. It depends on the pattern of client IO.

Sorry that I mistook max_small_allocation as 128KB, it's 16KB actually. There is no problem with ObjectDataBlcok.

…chedExtent

Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
@zhscn zhscn force-pushed the wip-lba-backref-node-size branch from ebd15e6 to 07577e3 Compare September 20, 2023 03:38
@cyx1231st
Copy link
Member

jenkins test api

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants