Comments (8)
Thanks, I didn't use any io_uring
specific tricks, I created this exmaple to compare with ritsu.
I don't use poll
before accept
, but use poll
before readv
, in order to better share buffer; I use readv
and writev
because they work in stable kernel; I did not use fixed opcode and IOSQE_IO_LINK
.
from io-uring.
Thanks, I didn't use any
io_uring
specific tricks, I created this exmaple to compare with ritsu .I don't use
poll
beforeaccept
, but usepoll
beforereadv
, in order to better share buffer; I usereadv
andwritev
because they work in stable kernel; I did not use fixed opcode andIOSQE_IO_LINK
.
So nothing special
in order to better share buffer
Well I don't agree with the idea you specified in the comment. Although you have polled before readv
, multiple readv
operations can still be run in parallel, only the readv
becomes very short, short doesn't mean that it doesn't need time to run.
我不同意那个帖的观点。就算你在readv
之前先poll
了一把,多个readv
仍然可以并发执行。先poll
一把只意味着readv
不会阻塞,但非阻塞操作执行仍然需要时间。
你想,磁盘I/O是不需要poll
的,但是对于io_uring来说磁盘I/O仍然是并发执行的,设计就是如此。
Even so, the grouped two operations readv
and writev
are not atomic, you can't expect writev
is run before other readv
is run
for the same buffer.
退一步说,就算在poll
之后readv
是原子性的,但是readv
和writev
这两个操作加起来肯定不是原子性的。你不能假设在前一个readv
执行之后就不会有别的readv
操作插进来。所以这个缓冲区还是有可能被其他readv
覆盖掉
from io-uring.
You misunderstood what he means. Actually we have a buffer pool, and we only take the buffer from pool after fd is ready.
Looking at ritsu's high-level code may be clearer.
see https://github.com/quininer/ritsu/blob/master/examples/tcp_echo.rs#L30
from io-uring.
所以你是在poll之后选择一个空闲的buffer用是吧
from io-uring.
Yes.
from io-uring.
我的代码,甚至用了 fixed_files & fixed_buffers,有时候运行起来也没你的代码快 😭
https://github.com/CarterLi/io_uring-echo-server/blob/switch/io_uring_echo_server.c#L122
我怀疑是不是 liburing 本身有性能瓶颈。。。
from io-uring.
我們在 matrix 私聊吧。
from io-uring.
ok
from io-uring.
Related Issues (20)
- missing multishot commands HOT 9
- missing opcode PollUpdate
- opcode::Recv , buf_group and multi question HOT 2
- open question about race with kernel that liburing had to fix HOT 1
- ffi::CString crash help HOT 9
- opcode Read misses IOSQE_BUFFER_SELECT flag? HOT 4
- Is it possible to use opcode::Accept with types::Fixed? HOT 3
- Consider derive Eq for DestinationSlot
- feature wanted: io_uring_submit_and_wait_timeout HOT 2
- Socket test fails on master HOT 4
- `Waking up` io-uring question HOT 1
- To set `nonblocking`-mode on streams or not? HOT 1
- After `SendZc` submission sender receives two messages HOT 2
- `SendToZc` implemetation HOT 1
- Expose access to user_data of squeue::Entry
- Help with timed events on a event loop structure
- Add changelog file HOT 1
- Building with bindgen feature fails with recent kernel headers. HOT 1
- Docs for `Read` opcode talk about setting `offset` to `-1`, yet `offset: u64` HOT 3
- Should `SubmissionQueue::push()` also check for `cq_overflow()`? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from io-uring.