Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#525] resizable shm support #527

Merged

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Nov 25, 2024

Notes for Reviewer

Makes the ZeroCopyConnection concept multi segment capable. Instead of using of UsedChunkList, that tracks all outgoing samples to recover them when a subscriber dies, we have now one UsedChunkList per segment.
The user can define how many segments at most the ZeroCopyConnection can manage in parallel. This is useful to avoid the overhead in the case that one has a static type and not the slice case as payload.

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Closes #525

@elfenpiff elfenpiff self-assigned this Nov 25, 2024
@elfenpiff elfenpiff changed the title BASED ON [#525] resizable shm support BASED ON 517 [#525] resizable shm support Nov 25, 2024
@elfenpiff elfenpiff changed the title BASED ON 517 [#525] resizable shm support BASED ON #517 [#525] resizable shm support Nov 25, 2024
@elfenpiff elfenpiff force-pushed the iox2-525-resizable-shm-support branch from 50d399e to 5dfcfae Compare November 25, 2024 19:31
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 83.93782% with 31 lines in your changes missing coverage. Please review.

Project coverage is 79.07%. Comparing base (949d2e0) to head (47b476d).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-cal/src/zero_copy_connection/common.rs 85.10% 14 Missing ⚠️
iceoryx2-bb/lock-free/src/spsc/index_queue.rs 69.23% 4 Missing ⚠️
...ck-free/src/spsc/safely_overflowing_index_queue.rs 81.25% 3 Missing ⚠️
iceoryx2-bb/container/src/queue.rs 71.42% 2 Missing ⚠️
iceoryx2-bb/container/src/slotmap.rs 90.00% 2 Missing ⚠️
iceoryx2-bb/container/src/vec.rs 66.66% 2 Missing ⚠️
iceoryx2-bb/lock-free/src/mpmc/container.rs 80.00% 2 Missing ⚠️
iceoryx2-bb/lock-free/src/mpmc/bit_set.rs 75.00% 1 Missing ⚠️
iceoryx2-bb/lock-free/src/mpmc/unique_index_set.rs 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #527      +/-   ##
==========================================
- Coverage   79.13%   79.07%   -0.07%     
==========================================
  Files         202      202              
  Lines       24815    24887      +72     
==========================================
+ Hits        19638    19680      +42     
- Misses       5177     5207      +30     
Files with missing lines Coverage Δ
...l/src/communication_channel/posix_shared_memory.rs 90.64% <100.00%> (ø)
...yx2-cal/src/communication_channel/process_local.rs 89.31% <100.00%> (ø)
iceoryx2-cal/src/dynamic_storage/mod.rs 100.00% <ø> (ø)
...yx2-cal/src/dynamic_storage/posix_shared_memory.rs 89.07% <100.00%> (-0.22%) ⬇️
iceoryx2-cal/src/shared_memory/mod.rs 100.00% <ø> (ø)
iceoryx2-cal/src/shm_allocator/pointer_offset.rs 79.48% <100.00%> (+6.15%) ⬆️
iceoryx2-cal/src/zero_copy_connection/mod.rs 12.50% <ø> (ø)
iceoryx2/src/port/details/publisher_connections.rs 98.68% <100.00%> (-1.32%) ⬇️
...ceoryx2/src/port/details/subscriber_connections.rs 94.80% <100.00%> (ø)
iceoryx2-bb/lock-free/src/mpmc/bit_set.rs 95.23% <75.00%> (ø)
... and 8 more

... and 6 files with indirect coverage changes

@elfenpiff elfenpiff force-pushed the iox2-525-resizable-shm-support branch from 53a6c76 to f656be3 Compare November 26, 2024 01:04
@elfenpiff elfenpiff force-pushed the iox2-525-resizable-shm-support branch from c9decdb to 4b58bec Compare December 1, 2024 18:41
@elfenpiff elfenpiff changed the title BASED ON #517 [#525] resizable shm support [#525] resizable shm support Dec 1, 2024
Comment on lines +61 to +63
pub const fn from_value(value: u64) -> PointerOffset {
Self(value)
}
Copy link
Member

Choose a reason for hiding this comment

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

Food for thought. Shouldn't this be unsafe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? You just create a PointerOffset nothing can cause undefined behavior or a segfault here.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe I was thinking too much of Box::from_raw but since one can create it from any offset + index, it would be moot.

…ads so that systems with many CPU cores can handle them as well
@elfenpiff elfenpiff requested a review from elBoberido December 4, 2024 11:19
@elfenpiff elfenpiff merged commit 0ad8d53 into eclipse-iceoryx:main Dec 4, 2024
48 checks passed
@elfenpiff elfenpiff deleted the iox2-525-resizable-shm-support branch December 4, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResizableSharedMemory support in ZeroCopyConnection
2 participants