Skip to content

[runtime] Feature: memory segments and batching #1550

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

iyzhang
Copy link
Contributor

@iyzhang iyzhang commented May 28, 2025

This PR closes #88

@iyzhang iyzhang self-assigned this May 28, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements memory segments and batching support across the networking stack by replacing single-buffer operations with batch processing using ArrayVec. Key changes include:

  • Updating TCP, UDP, and lower-layer protocols to process batches of packets.
  • Replacing the old RECEIVE_BATCH_SIZE constant with MAX_BATCH_SIZE_NUM_PACKETS.
  • Updating related runtime and OS modules (demikernel, catnap, catnip, etc.) to support the new batching logic.

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/inetstack/protocols/layer4/tcp/peer.rs Updated push/pop functions to accept and return ArrayVec batches.
src/inetstack/protocols/layer4/tcp/established/sender.rs Modified push function to iterate over a batch of buffers.
src/inetstack/protocols/layer4/tcp/established/receiver.rs Adjusted pop function logic for handling batched packet retrieval.
src/inetstack/protocols/layer4/established/mod.rs Updated push/pop interfaces to work with packet batches.
src/inetstack/protocols/layer4/mod.rs Replaced single-buffer push/pop with batch-based operations for UDP.
src/inetstack/protocols/layer3/mod.rs, layer2/mod.rs Updated receiver and transmitter to use MAX_BATCH_SIZE_NUM_PACKETS.
src/inetstack/consts.rs Deprecated RECEIVE_BATCH_SIZE in favor of MAX_BATCH_SIZE_NUM_PACKETS.
src/demikernel/libos/network/queue.rs, libos.rs Adapted network queue operations to work with buffer batches.
src/catpowder and src/catnip runtimes, catnap/linux modules Updated physical layer and transport implementations to support batching.

@iyzhang iyzhang marked this pull request as draft May 28, 2025 18:20
@iyzhang iyzhang force-pushed the feature-memory-add-segments branch from 74af05a to fc32d02 Compare June 23, 2025 18:47
@iyzhang iyzhang marked this pull request as ready for review June 23, 2025 18:49
Copy link
Contributor

@anandbonde anandbonde left a comment

Choose a reason for hiding this comment

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

The overall approach looks good! Left a few comments.

@iyzhang iyzhang force-pushed the feature-memory-add-segments branch from fc32d02 to 10ed97c Compare June 27, 2025 18:03
@iyzhang iyzhang force-pushed the feature-memory-add-segments branch from 81e7f63 to dd0f85e Compare July 9, 2025 17:11
Copy link
Contributor

@anandbonde anandbonde left a comment

Choose a reason for hiding this comment

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

Looks good.

@iyzhang iyzhang force-pushed the feature-memory-add-segments branch from 5f3027a to 84281cf Compare July 9, 2025 17:31
@iyzhang iyzhang force-pushed the feature-memory-add-segments branch from 84281cf to 52c6103 Compare July 9, 2025 17:47
@iyzhang iyzhang merged commit 6042e01 into dev Jul 9, 2025
14 checks passed
@iyzhang iyzhang deleted the feature-memory-add-segments branch July 9, 2025 18:15
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.

[pdpix] Support Scatter-Gather Arrays with Multiple Segments
2 participants