From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 8/8] poller: allow suppressing overtime warnings
Date: Thu, 14 Aug 2025 22:28:05 +0200 [thread overview]
Message-ID: <20250814202805.354827-8-a.fatoum@barebox.org> (raw)
In-Reply-To: <20250814202805.354827-1-a.fatoum@barebox.org>
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@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
prev parent reply other threads:[~2025-08-14 20:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 20:27 [PATCH 1/8] common: fix outdated barebox_set_hostname comment Ahmad Fatoum
2025-08-14 20:27 ` [PATCH 2/8] RISC-V: virt: riscvemu: set better hostname/model Ahmad Fatoum
2025-08-14 20:28 ` [PATCH 3/8] netconsole: bump down ip/port not set messages to info Ahmad Fatoum
2025-08-14 20:28 ` [PATCH 4/8] RISC-V: cpuinfo: enable structured I/O Ahmad Fatoum
2025-08-14 20:28 ` [PATCH 5/8] commands: bfetch: add RISC-V cpu/firmware info Ahmad Fatoum
2025-08-14 20:28 ` [PATCH 6/8] RISC-V: riscvemu: update configs for web demo Ahmad Fatoum
2025-08-14 20:28 ` [PATCH 7/8] RISC-V: rv64i_defconfig: enable Virt I/O Ahmad Fatoum
2025-08-14 20:28 ` Ahmad Fatoum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250814202805.354827-8-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox