From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] poller: activate POLLER_WARN_OVERTIME only on third strike
Date: Wed, 12 Nov 2025 16:10:58 +0100 [thread overview]
Message-ID: <20251112151058.540654-1-a.fatoum@pengutronix.de> (raw)
This warning was meant to address the case that a poller repeatedly
takes too long that interactive usage is impacted.
I frequently see this warning during initial USB gadget set up and that
is not really useful to show every user and developers can use the
poller command, so let's wait until we are on our third (2nd when
counting from 0) overtime to print the one time warning.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/Kconfig | 2 +-
common/poller.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/Kconfig b/common/Kconfig
index d923d4c4b628..c6a7f2feabd3 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1104,7 +1104,7 @@ config POLLER_WARN_OVERTIME
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.
+ three times will trigger a one-time warning.
config BTHREAD
bool "barebox co-operative (green) thread infrastructure"
diff --git a/common/poller.c b/common/poller.c
index 5dc2be97211d..ca0d68d6cb27 100644
--- a/common/poller.c
+++ b/common/poller.c
@@ -135,8 +135,8 @@ void poller_call(void)
duration_ms = ktime_ms_delta(ktime_get(), start);
if (duration_ms > POLLER_MAX_RUNTIME_MS) {
if (IS_ENABLED(CONFIG_POLLER_WARN_OVERTIME) &&
- !poller->overtime)
- pr_warn("'%s' took unexpectedly long: %llums\n",
+ poller->overtime == 2)
+ pr_warn("'%s' takes unexpectedly long: %llums\n",
poller->name, duration_ms);
if (poller->overtime < U16_MAX)
--
2.47.3
next reply other threads:[~2025-11-12 15:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 15:10 Ahmad Fatoum [this message]
2025-11-14 13:00 ` Sascha Hauer
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=20251112151058.540654-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--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