Motivation:
At least in the throughput benchmarks it has shown that IOSQE_ASYNC
gives a lot of performance improvements. Lets enable it by default for
now and maybe make it configurable in the future
Modifications:
Use IOSEQ_ASYNC
Result:
Better performance
Motivation:
We should submit multiple IO ops at once to reduce the syscall overhead.
Modifications:
- Submit multiple IO ops in batches
- Adjust default ringsize
Result:
Much better performance
Motivation:
We should only reset the RecvByteBufAllocator.Handle when a new "read
loop" starts. Otherwise the handle will not be able to correctly limit
reads.
Modifications:
- Move reset(...) call into pollIn(...)
- Remove all @Ignore
Result:
The whole testsuite passes
Motivation:
Due a bug SO_BACKLOG was not supported via ChannelOption when using io_uring. Be
Modification:
- Add SO_BACKLOG to the supported ChannelOptions.
- Merge IOUringServerChannelConfig into IOUringServerSocketChannelConfig
Result:
SO_BACKLOG is supported
Motivation:
we should move the initAddress to LinuxSocket JNI as it is only used there
Modifications:
- cleanup
- move initAddress to linux socket JNI
Result:
it's cleaner
Motivation:
To ensure we use the correct values when passing values from Java to C and the other way around it is better to use JNI to lookup the values.
Modifications:
Add NativeStaticallyRefererencedJniMethods and use it (just as we do in kqueue / epoll)
Results:
More robust code
Motivation:
We need to cache the localAddress after the connect was complete
Modifications:
- Call socket.localAddress() after the connect was complete
- Enable test again
Result:
Correctly set localAddress after connect was successful
Motivation:
We did have a bug in how we calculated the values for the timespec which lead to incorrect wakeups. Beside this we also missed to always call runAllTasks() which is needed to fetch the ready to be executed scheduled tasks.
Modifications:
- Fix timespec setup
- Always call runAllTasks()
- Add extra testcase
- Remove @Ignore from previous failing test
Result:
Timeouts work as expected
Motivation:
We need more testing for io_uring to be consistent with the others transports
Modifications:
Add more tests by extending the testsuite (still some to add) and mark failing tests as ignore. These ignored tests should be fixed one by one in followup commits
Results:
More testing
Motivation:
CompositeByteBuf need some special handling as well as we have multiple buffers wrapped that needs to be written via writev.
Modification:
Also handle ByteBuf with more then one nioBuffer special.
Result:
Writing CompositeByteBuf works
Motivation:
Sometimes accept failed as we not correctly set the active variable when constructing the server channel. This lead to the situation that we tried to add POLLIN before the channel become active and so tried to call accept before it was listen.
Modifications:
- Use the correct constructor
- Cleanup
Result:
No more accept failures.
Motivation:
When accepting a Channel we did register it for POLLRDHUP, but unfortunally we used the IOUringSubmissionQueue that is tied to the IOUringEventLoop that is used for the ServerChannel. This is not correct as the EventLoop used for the accepted Channel may be different.
Modification:
Move logic into doRegister() and so register for POLLRDHUP on the right IOURingSubmissionQueue
Result:
Correct POLLRDHUP handling
Motivation:
We need to respect RecvByteBufAllocator.Handle.continueReading() so settings like MAX_MESSAGES_PER_READ are respected. This also ensures that AUTO_READ is correctly working in all cases
Modifications:
- Correctly respect continueReading();
- Fix IOUringRecvByteAllocatorHandle
- Cleanup
Result:
Correctly handling reading
Motivation:
We did not correctly compute all fields when POLL_REMOVE entry was calculate. Which could lead to not finding the right operation.
Modifications:
- Correctly fill all fields
- Fix unit tests
Result:
Remove IO_POLL operations work again as expected
Motivation:
Due a bug we did not include the IOURING based transport for clients in the testsuite. When enabling this it failed due a bug related to when we register POLLRDHUP.
Modification:
- Include IOURING clients in testsuite
- Register for RDHUP on the right time
Result:
Correctly handle RDHUP and also test IOURING for clients
Motivation:
we should use kHead(with acquire memory barrier) instead of sqeHead as submit() is called internally when sqe is full
Modification:
-submit is called internally when sqe is full
-added a new sqe full test
Result:
you no longer need to check if the sqe is full when you add a new event
Motivation:
segmentation is caused in IovecArrayPool.release because the default of iovecMemoryAddress is 0
Modification:
-set default to -1
-some cleanups
-added new testsuite tests
Result:
fixed segmentation error
Motivation:
We not correctly handled errors and also had some problems with home POLL* was handled.
Modifictions:
- Cleanup
- No need to for links anymore
- Add error handling for most operations (poll still missing)
- Add better handling for RDHUP
- Correctly handle writeScheduled flag for writev
Result:
Cleaner and more correct code
Motivation:
writev which allows to write data into multiple buffers
Modification:
-Added iovec array pool to manage iov memory
-flush override to make sure that write is not called
Result:
performance is much better
Motivation:
we should remove pollIn link, as we don't use pollIn linking anymore
Modification:
-some cleanups in the tests and in IOUring
-pollIn linking was removed
Result:
clean code
Motivation:
We must correctly use the polling support of io_uring to reduce the number of events in flight + only allocate buffers if really needed. For this we should respect the different poll masks and only do the corresponding IO action once the fd becomes ready for it.
Modification:
- Correctly respect poll masks and so only schedule an IO event if the fd is ready for it
- Move some code for cleanup
Result:
More correct usage of io_uring and less memory usage
Motivation:
if connect returns EINPROGRESS we send POLL OUT and check
via socket.finishConnect if the connection is successful
Modifications:
-added new io_uring connect op
-use a directbuffer for the socket address
Result:
you are able to connect to a peer
Motivation:
when you submit a poll, io_uring still hold reference to it even if close is called
source io_uring mailing list(https://lore.kernel.org/io-uring/27657840-4E8E-422D-93BB-7F485F21341A@kernel.dk/T/#t)
Modification:
-To delete fd reference in io_uring, we use POLL_REMOVE to avoid a server socket address error
-Added a POLL_REMOVE test
Result:
server can be closed and restarted
Motivation:
We did create a lot of objects related to the completion queue and submission queue which produced a lot of GC. Beside this we also did maintain an extra map which is not really needed as we can encode everything that we need in the user_data field.
Modification:
- Reduce complexity and GC pressure by store needed informations in the user_data field
- Small refactoring of the code to move channel related logic to the channel
- Remove unused classes
- Use callback to process stuff in the completion queue and so remove all GC created by it
- Simplify by not storing channel and buffer in the event
Result:
Less GC pressure and no extra lookups for events needed
Motivation:
We use eventfd in our io_uring based transport to wakeup the eventloop. When doing so we need to be careful that we read any data previous written to it.
Modification:
- Correctly read data that was written to eventfd before submit another event related to it to the submission queue as otherwise we will see another completion event related to it asap
- Ensure we not remove the wrong event from the storted event ids (we did remove the wrong before because we reused the Event object)
- ensure we only use the submission queue from the EventLoop thread in all cases
- add another unit test
Result:
Wakeups via eventfd work as expected
Motivation:
We need to use deadlineToDelayNanos(...) to calculate the timeout for io_uring as otherwise the timeout will be scheduled at the wrong time in the future
Modifications:
Make use of deadlineToDelayNanos(...)
Result:
Correctly schedule timeou