关于io-uring队列深度使用的讨论
- Dominant language
- C++
- Stars
- 10.2k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
[3FS](https://github.com/deepseek-ai/3FS/tree/main)/[src](https://github.com/deepseek-ai/3FS/tree/main/src)/[storage](https://github.com/deepseek-ai/3FS/tree/main/src/storage)/[aio](https://github.com/deepseek-ai/3FS/tree/main/src/storage/aio)
/AioReadWorker.cc
在这一步部分的代码当中,对于iouring的提交和收割,你们是这么写的:
```c++
do {
// 2. collect a batch of read jobs.
status.collect();
// 3. submit a batch of read jobs.
status.submit();
// 4. wait a batch of events.
while (status.inflight()) {
status.reap(config_.min_complete());
};
} while (status.hasUnfinishedBatchReadJob());
```
也就是基本遵循(一次提交,对应一次io收割)。
这一步似乎写成两个轮询的线程会有更高的效率?因为在现有实现下,对于ssd队列深度的使用基本等于一次提交的子请求数量。如果改写成在两个线程中进行:
```c++
// submit IO thread
do {
// 2. collect a batch of read jobs.
status.collect();
// 3. submit a batch of read jobs.
status.submit();
} while (status.hasUnfinishedBatchReadJob());
// reap IO thread
while (status.inflight()) {
status.reap(config_.min_complete());
};
```
此时,第二次提交的批量请求,也能够直接投入到sqe环中,而由另一个线程进行不断收割IO,队列深度的利用率和整体io效率也许会更高?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.