0
0
Fork 0
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:
Jason Volk 2018-12-26 15:16:02 -08:00
parent 3d79c94bb2
commit 528dff78ff

View file

@ -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)