Add io_uring support#13932
Open
Biquaternions wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To complement the work done by Beanes in #13929, this PR implements io_uring transport to Paper, including its version of Unix Domain socket support.
As such, this PR depends on #13929 being merged first, as currently Minecraft seems to rely on a hacky workaround to hide a race condition while setting up compression.
I do agree that Paper might not get a huge boost from io_uring, since it won't handle as many active connections as Velocity, but Folia will most definitely get a significant improvement from this. And with this not being a region-related feature, it is more suitable have it on Paper and let Folia get it downstream.
This also relies on removing the synchronization in
Connection#disconnectfrom the netty threads, as it will trigger Netty's deadlock prevention in the form ofio.netty.util.concurrent.BlockingOperationException.This used to be part of Paper, but was removed in 8021488, currently unsure if was intentional or not as it doesn't seem to affect the disconnection state fixes.
I'm open to discussion whether synchronizing on the netty threads is appropriate or not in this scenario, or if this should be handled differently for io_uring.
This has also been made opt-in configurable, following Velocity's:
PaperMC/Velocity@ae31233