[GH-ISSUE #321] 关于io-uring队列深度使用的讨论 #201

Open
opened 2026-10-26 09:47:02 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Alexanderchens on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/deepseek-ai/3FS/issues/321

3FS/src/storage/aio
/AioReadWorker.cc
在这一步部分的代码当中,对于iouring的提交和收割,你们是这么写的:

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队列深度的使用基本等于一次提交的子请求数量。如果改写成在两个线程中进行:

// 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效率也许会更高?

Originally created by @Alexanderchens on GitHub (Aug 14, 2025). Original GitHub issue: https://github.com/deepseek-ai/3FS/issues/321 [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效率也许会更高?
Author
Owner

@qum1nzhennan commented on GitHub (Jul 18, 2026):

确实

<!-- gh-comment-id:5011596909 --> @qum1nzhennan commented on GitHub (Jul 18, 2026): 确实
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#201
No description provided.