[PATCH 8/8] poller: allow suppressing overtime warnings
Ahmad Fatoum
a.fatoum at barebox.org
Thu Aug 14 13:28:05 PDT 2025
In emulation and especially the web demo, pollers may be delayed because
the virtual machine does not have exclusive usage of the CPU.
Warning about delayed pollers in that case is not useful, so allow
disabling the warning. The poller command can still be used to check
overtime.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
The irony of me sending this out after hours is not lost on me.
---
common/Kconfig | 9 +++++++++
common/poller.c | 3 ++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/common/Kconfig b/common/Kconfig
index b32a7cb2960b..ad211d1fa519 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1115,6 +1115,15 @@ config POLLER
bool "generic polling infrastructure"
select HAS_SCHED
+config POLLER_WARN_OVERTIME
+ bool "warn on poller overtime"
+ depends on POLLER
+ default y
+ help
+ Pollers are meant to poll and quickly execute actions.
+ exceeding the maximum runtime of POLLER_MAX_RUNTIME_MS
+ will trigger a one-time warning.
+
config BTHREAD
bool "barebox co-operative (green) thread infrastructure"
select HAS_SCHED
diff --git a/common/poller.c b/common/poller.c
index 18bd9c80f4b3..5dc2be97211d 100644
--- a/common/poller.c
+++ b/common/poller.c
@@ -134,7 +134,8 @@ void poller_call(void)
duration_ms = ktime_ms_delta(ktime_get(), start);
if (duration_ms > POLLER_MAX_RUNTIME_MS) {
- if (!poller->overtime)
+ if (IS_ENABLED(CONFIG_POLLER_WARN_OVERTIME) &&
+ !poller->overtime)
pr_warn("'%s' took unexpectedly long: %llums\n",
poller->name, duration_ms);
--
2.39.5
More information about the barebox
mailing list