mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::aio: Flush the io_submit queue on all non-reading ops.
This commit is contained in:
parent
3d79c94bb2
commit
528dff78ff
1 changed files with 16 additions and 1 deletions
17
ircd/aio.cc
17
ircd/aio.cc
|
@ -482,7 +482,22 @@ noexcept try
|
|||
assert(request.aio_data == uintptr_t(&request));
|
||||
const ctx::critical_assertion ca;
|
||||
queue.at(count++) = static_cast<iocb *>(&request);
|
||||
if(count >= size_t(max_submit) || count >= queue.size())
|
||||
|
||||
const bool flush_now
|
||||
{
|
||||
// The queue has reached the configured size
|
||||
count >= size_t(max_submit)
|
||||
|
||||
// The queue has reached its maximum size
|
||||
|| count >= queue.size()
|
||||
|
||||
// The request causes serialization. This is considered true for all
|
||||
// non-reading events, even for different files and locations. It may
|
||||
// be possible to optimize this condition.
|
||||
|| request.aio_lio_opcode != IOCB_CMD_PREADV
|
||||
};
|
||||
|
||||
if(flush_now)
|
||||
return flush();
|
||||
|
||||
if(count == 1)
|
||||
|
|
Loading…
Reference in a new issue