Add queue stall tracking

This commit is contained in:
Vitaliy Filippov
2020-01-10 01:23:46 +03:00
parent 522a9db0e2
commit b3f2102f33
9 changed files with 30 additions and 0 deletions
+12
View File
@@ -64,6 +64,11 @@ bool blockstore_impl_t::is_started()
return initialized == 10;
}
bool blockstore_impl_t::is_stalled()
{
return queue_stall;
}
// main event loop - produce requests
void blockstore_impl_t::loop()
{
@@ -100,6 +105,7 @@ void blockstore_impl_t::loop()
else
{
// try to submit ops
unsigned initial_ring_space = ringloop->space_left();
auto cur_sync = in_progress_syncs.begin();
while (cur_sync != in_progress_syncs.end())
{
@@ -190,6 +196,12 @@ void blockstore_impl_t::loop()
{
throw std::runtime_error(std::string("io_uring_submit: ") + strerror(-ret));
}
if ((initial_ring_space - ringloop->space_left()) > 0)
{
live = true;
}
queue_stall = !live && !ringloop->get_loop_again();
live = false;
}
}