0
0
Fork 0
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:
Jason Volk 2021-10-27 15:21:14 -07:00
parent c643cc7507
commit 1c668b038c
2 changed files with 14 additions and 2 deletions

View file

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

View file

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