mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 18:18:56 +02:00
ircd:🆑 Move submit blocking watchdog threshold into conf item.
This commit is contained in:
parent
c643cc7507
commit
1c668b038c
|
@ -31,6 +31,7 @@ namespace ircd::cl
|
|||
extern const info::versions version_api;
|
||||
extern info::versions version_abi;
|
||||
extern conf::item<milliseconds> nice_rate;
|
||||
extern conf::item<uint64_t> watchdog_tsc;
|
||||
extern conf::item<std::string> envs[];
|
||||
extern conf::item<bool> profile_queue;
|
||||
extern conf::item<bool> enable;
|
||||
|
|
15
ircd/cl.cc
15
ircd/cl.cc
|
@ -143,6 +143,13 @@ ircd::cl::nice_rate
|
|||
{ "default", 1L },
|
||||
};
|
||||
|
||||
decltype(ircd::cl::watchdog_tsc)
|
||||
ircd::cl::watchdog_tsc
|
||||
{
|
||||
{ "name", "ircd.cl.watchdog.tsc" },
|
||||
{ "default", 268'435'456L },
|
||||
};
|
||||
|
||||
decltype(ircd::cl::primary_stats)
|
||||
ircd::cl::primary_stats
|
||||
{
|
||||
|
@ -1216,15 +1223,19 @@ ircd::cl::handle_submitted(cl::exec *const &exec,
|
|||
ctx::sleep(opts.nice * milliseconds(nice_rate));
|
||||
}
|
||||
|
||||
/// Checks if the OpenCL runtime blocked this thread to sound the alarms.
|
||||
void
|
||||
ircd::cl::check_submit_blocking(cl::exec *const &exec,
|
||||
const exec::opts &opts)
|
||||
{
|
||||
const auto threshold
|
||||
const uint64_t &threshold
|
||||
{
|
||||
268'435'456
|
||||
watchdog_tsc
|
||||
};
|
||||
|
||||
if(!threshold)
|
||||
return;
|
||||
|
||||
const auto submit_cycles
|
||||
{
|
||||
prof::cycles() - exec->ts
|
||||
|
|
Loading…
Reference in a new issue