From: Breno Leitao <leitao@debian.org>
To: Gustavo Luiz Duarte <gustavold@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Shuah Khan <shuah@kernel.org>,
paulmck@kernel.org, davej@codemonkey.org.uk, riel@surriel.com,
asantostc@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org, samuelcrossley@gmail.com,
kernel-team@meta.com
Subject: Re: [PATCH net-next RFC 4/6] netconsole: tell the target when the rate limit drops messages
Date: Fri, 21 Aug 2026 05:41:51 -0700 [thread overview]
Message-ID: <aohGyZjH-2lfMpGN@gmail.com> (raw)
In-Reply-To: <CAGSyskXshZTuBwiOPzp1j-d3He07Sx9OZGqRq4k6SG_kBwuKMA@mail.gmail.com>
On Thu, Aug 20, 2026 at 09:49:47PM +0100, Gustavo Luiz Duarte wrote:
> On Tue, Aug 18, 2026 at 11:30 AM Breno Leitao <leitao@debian.org> wrote:
> > +static void send_ratelimit_notice(struct netconsole_target *nt, bool extended)
> > +{
> > + int len = 0;
> > + u64 ts_usec;
> > + u32 drops;
> > +
> > + drops = netconsole_take_drops(nt);
> > + if (!drops)
> > + return;
> > +
> > + if (extended) {
> > + /* append the extended headers */
> > + if (nt->release)
> > + len = scnprintf(nt->buf, sizeof(nt->buf), "%s,",
> > + init_utsname()->release);
> > +
> > + ts_usec = div_u64(local_clock(), NSEC_PER_USEC);
> > + len += scnprintf(nt->buf + len, sizeof(nt->buf) - len,
> > + "%u,0,%llu,-;", LOGLEVEL_WARNING, ts_usec);
> > + }
>
> This additional message with sequence number zero in the middle of a
> stream looks awkward.
First of all Thanks for the review.
Agreed, but I don't think there is any other solution rather than a 0,
given this is coming from printk(), and we don't want to
conflict/collide.
> I don't think we need to send a notice about dropped messages to
> extended console targets. Those targets can detect dropped messages by
> tracking the sequence number in the message header.
I've come up with this "extra" message in a say to get it very clear
that some messages were rate limit.
We can certainly do it using the sequence number if we enable message
counting.
What would be an option to tell we had ratelimited for those not using
message count?
Thanks!
--breno
next prev parent reply other threads:[~2026-08-21 12:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 10:29 [PATCH net-next RFC 0/6] netconsole: Support messages ratelimit-ing Breno Leitao
2026-08-18 10:29 ` [PATCH net-next RFC 1/6] netconsole: add a per-target message rate limit Breno Leitao
2026-08-18 10:29 ` [PATCH net-next RFC 2/6] netconsole: allow configuring the rate limit interval through configfs Breno Leitao
2026-08-18 10:29 ` [PATCH net-next RFC 3/6] netconsole: allow configuring the rate limit burst " Breno Leitao
2026-08-18 10:29 ` [PATCH net-next RFC 4/6] netconsole: tell the target when the rate limit drops messages Breno Leitao
2026-08-20 20:49 ` Gustavo Luiz Duarte
2026-08-21 12:41 ` Breno Leitao [this message]
2026-08-18 10:29 ` [PATCH net-next RFC 5/6] docs: netconsole: document rate limit feature Breno Leitao
2026-08-18 10:29 ` [PATCH net-next RFC 6/6] selftests: netcons: test the per-target rate limit Breno Leitao
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=aohGyZjH-2lfMpGN@gmail.com \
--to=leitao@debian.org \
--cc=andrew+netdev@lunn.ch \
--cc=asantostc@gmail.com \
--cc=corbet@lwn.net \
--cc=davej@codemonkey.org.uk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavold@gmail.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulmck@kernel.org \
--cc=riel@surriel.com \
--cc=samuelcrossley@gmail.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.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