Skip to content

Bound IOCP staging allocations independently of caller buffer capacity #534

Description

@LunaStev

iocp_start_io allocates and zeroes length bytes for every operation, accepting sizes up to 4,294,967,295 bytes. Writes additionally copy the complete requested range. A large read capacity therefore reserves an equally large second buffer even when only a small message will arrive. Multiple outstanding requests amplify this cost.

Owned kernel-visible storage is intentional for cancellation safety; this report is about bounding that storage, not removing ownership protection.

Source evidence at the head of #520:

Acceptance:

  • Limit per-operation staging size or introduce another explicitly bounded ownership strategy.
  • Keep short-read semantics and let read_exact/write_all advance correctly through partial operations.
  • Measure allocation counts/bytes for bounded concurrent requests with large caller capacities and small actual transfers.
  • Cover cancellation and allocation failure without releasing storage before its completion acknowledgement.

Related: #445. Native buffer lifetime must remain correct while reducing resource use.

Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. This follows up the implementation introduced in draft PR #520.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedThe issue requires extra attention or help from others.os performance optimizationIssues related to optimizing performance for a specific operating system.performanceIssues related to performance or optimization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions