GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — transport: Avoid io_uring completion callback allocation by massiccio · Pull Request #17457 · netty/netty

Conversation

@massiccio

@massiccio massiccio commented Sep 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation:

IoUringIoHandler creates a completion callback on the io_uring poll path. C2 cannot eliminate the callback across the compiled helper boundary, causing avoidable per-poll allocation.

Modification:

Cache the stateless io_uring completion callback in a final instance field and reuse it across (1) normal polling and (2) shutdown completion processing.

The stateful DrainFdEventCallback remains local because it tracks eventfd state.

Validation:

  • Real Linux io_uring workload completed at approximately 11,000 requests/sec for 120 seconds.
  • Exact JFR allocation capture:
    • Before: 84 IoUringIoHandler lambda events, approximately 78 MB event-loop allocation.
    • After: 0 lambda events, approximately 17 MB event-loop allocation.
  • No throughput regression, errors, pending requests, or missed requests.

Result:

Fixes #17437

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@massiccio
transport: Avoid io_uring completion callback allocation
4fca321
Motivation: IoUringIoHandler creates a completion callback on the io_uring poll path. C2 cannot eliminate the callback across the compiled helper boundary, causing avoidable per-poll allocation.

Modifications:

Cache the stateless CompletionCallback in a final instance field and reuse it for normal completion processing and shutdown draining. Preserve the local stateful eventfd callback.
franz1981
franz1981 approved these changes Sep 13, 2026
View reviewed changes

@franz1981 franz1981 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Waiting for the CI but +1 from me

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@testlens-app

testlens-app Bot commented Sep 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 4fca321
▶️ Tests: 463832 executed
⚪️ Checks: 27/27 completed


Learn more about TestLens at testlens.app/docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 14, 2026
@normanmaurer normanmaurer added the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 14, 2026
@normanmaurer

normanmaurer commented Sep 14, 2026

Copy link
Copy Markdown
Member

@massiccio did you sign our icla yet ? https://netty.io/s/icla

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@massiccio

massiccio commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@normanmaurer I did.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer merged commit a0faa5e into netty:4.2 Sep 14, 2026
28 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Sep 14, 2026

Copy link
Copy Markdown
Member

@massiccio merged... thanks!

massiccio reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@massiccio
massiccio deleted the io-uring-cache-completion-callback branch September 14, 2026 07:56
@netty-project-bot

netty-project-bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17467

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 14, 2026
@netty-project-bot netty-project-bot mentioned this pull request Sep 14, 2026
Auto-port 5.0: transport: Avoid io_uring completion callback allocation #17467
Merged
normanmaurer pushed a commit that referenced this pull request Sep 14, 2026
@netty-project-bot @massiccio
Auto-port 5.0: transport: Avoid io_uring completion callback allocati…
bbb330d
…on (#17467)

Auto-port of #17457 to 5.0
Cherry-picked commit: a0faa5e

---
# Motivation: 

IoUringIoHandler creates a completion callback on the io_uring poll
path. C2 cannot eliminate the callback across the compiled helper
boundary, causing avoidable per-poll allocation.

# Modification:

Cache the stateless io_uring completion callback in a final instance
field and reuse it across (1) normal polling and (2) shutdown completion
processing.

The stateful DrainFdEventCallback remains local because it tracks
eventfd state.

Validation:
- Real Linux io_uring workload completed at approximately 11,000
requests/sec for 120 seconds.
- Exact JFR allocation capture:
- Before: 84 IoUringIoHandler lambda events, approximately 78 MB
event-loop allocation.
  - After: 0 lambda events, approximately 17 MB event-loop allocation.
- No throughput regression, errors, pending requests, or missed
requests.

# Result:

Fixes #17437

Co-authored-by: massiccio <[email protected]>
@normanmaurer normanmaurer mentioned this pull request Oct 1, 2026
child5 #17695
Closed
@normanmaurer normanmaurer mentioned this pull request Oct 26, 2026
crisp nova cceda091 #18109
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@franz1981 franz1981 franz1981 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.19.Final

Development

Successfully merging this pull request may close these issues.

io_uring handler allocates a completion callback on every poll cycle

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@massiccio @normanmaurer @netty-project-bot @franz1981
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.