0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-13 21:10:32 +01:00

ircd::fs::aio: Count io_submit() 'stalls' in stats.

This commit is contained in:
Jason Volk 2019-04-10 16:50:37 -07:00
parent ba46e8c005
commit 0b51a10a44
3 changed files with 38 additions and 15 deletions

View file

@ -58,6 +58,7 @@ struct ircd::fs::aio::stats
uint64_t errors {0}; ///< count of response errcodes
uint64_t reads {0}; ///< count of read complete
uint64_t writes {0}; ///< count of write complete
uint64_t stalls {0}; ///< count of io_submit's blocking.
uint64_t bytes_requests {0}; ///< total bytes for requests created
uint64_t bytes_complete {0}; ///< total bytes for requests completed

View file

@ -810,17 +810,35 @@ size_t
ircd::fs::aio::system::io_submit()
try
{
const ctx::syscall_usage_warning message
#ifndef NDEBUG
const size_t count[3]
{
"fs::aio::system::submit(in_flight:%zu qcount:%zu r:%zd w:%zd s:%zd)",
in_flight,
qcount,
count_queued(op::READ),
count_queued(op::WRITE),
count_queued(op::SYNC),
};
return syscall<SYS_io_submit>(head.get(), qcount, queue.data());
ctx::syscall_usage_warning warning
{
"fs::aio::system::submit(in_flight:%zu qcount:%zu r:%zu w:%zu s:%zu)",
in_flight,
qcount,
count[0],
count[1],
count[2],
};
#endif
const auto ret
{
syscall<SYS_io_submit>(head.get(), qcount, queue.data())
};
#ifndef NDEBUG
stats.stalls += warning.timer.stop() > 0;
#endif
return ret;
}
catch(const std::system_error &e)
{

View file

@ -966,14 +966,8 @@ console_cmd__aio(opt &out, const string_view &line)
<< std::setw(9) << std::right << s.max_writes
<< std::endl;
out << std::setw(18) << std::left << "errors"
<< std::setw(9) << std::right << s.errors
<< " " << pretty(iec(s.bytes_errors))
<< std::endl;
out << std::setw(18) << std::left << "cancel"
<< std::setw(9) << std::right << s.cancel
<< " " << pretty(iec(s.bytes_cancel))
out << std::setw(18) << std::left << "submits"
<< std::setw(9) << std::right << s.submits
<< std::endl;
out << std::setw(18) << std::left << "handles"
@ -984,8 +978,18 @@ console_cmd__aio(opt &out, const string_view &line)
<< std::setw(9) << std::right << s.events
<< std::endl;
out << std::setw(18) << std::left << "submits"
<< std::setw(9) << std::right << s.submits
out << std::setw(18) << std::left << "stalls"
<< std::setw(9) << std::right << s.stalls
<< std::endl;
out << std::setw(18) << std::left << "errors"
<< std::setw(9) << std::right << s.errors
<< " " << pretty(iec(s.bytes_errors))
<< std::endl;
out << std::setw(18) << std::left << "cancel"
<< std::setw(9) << std::right << s.cancel
<< " " << pretty(iec(s.bytes_cancel))
<< std::endl;
return true;