LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Safonov <dima@arista.com>
To: "Theodore Y. Ts'o" <tytso@mit.edu>
Cc: linux-kernel@vger.kernel.org, 0x7f454c46@gmail.com,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 1/2] random: Omit double-printing ratelimit messages
Date: Thu, 10 May 2018 20:50:07 +0100 [thread overview]
Message-ID: <1525981807.28243.9.camel@arista.com> (raw)
In-Reply-To: <20180510194041.GH8335@thunk.org>
On Thu, 2018-05-10 at 15:40 -0400, Theodore Y. Ts'o wrote:
> On Thu, May 10, 2018 at 07:37:40PM +0100, Dmitry Safonov wrote:
> >
> > Ok, then what's the purpose of those messages?
> > : pr_notice("random: %d get_random_xx warning(s) missed "
> > : "due to ratelimiting\n",
> > : unseeded_warning.missed);
> > : pr_notice("random: %d urandom warning(s) missed "
> > : "due to ratelimiting\n",
> > : urandom_warning.missed);
> >
> > I thought you want to print the summary after initializing random,
> > not once per second?
>
> Yes, and that's what is happening today. The "output lines
> suppressed
> due to ratelimiting" message is only printed out by
> printk_ratelimit()
> function, which we are *not* using.
random uses __ratelimit() which calls ___ratelimit() with a function
name. Depending on !RATELIMIT_MSG_ON_RELEASE it prints how many
messages were suppressed every ratelimit interval (1 second for random)
and flushes ratelimit_state::missed:
:if (time_is_before_jiffies(rs->begin + rs->interval)) {
: if (rs->missed) {
: if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) {
: printk_deferred(KERN_WARNING
: "%s: %d callbacks suppressed\n",
: func, rs->missed);
: rs->missed = 0;
: }
: }
: rs->begin = jiffies;
: rs->printed = 0;
:}
--
Thanks,
Dmitry
next prev parent reply other threads:[~2018-05-10 19:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 12:52 [PATCH 0/2] ratelimit: Do not lose messages under limit Dmitry Safonov
2018-05-10 12:52 ` [PATCH 1/2] random: Omit double-printing ratelimit messages Dmitry Safonov
2018-05-10 18:19 ` Theodore Y. Ts'o
2018-05-10 18:37 ` Dmitry Safonov
2018-05-10 19:40 ` Theodore Y. Ts'o
2018-05-10 19:50 ` Dmitry Safonov [this message]
2018-05-11 3:51 ` Theodore Y. Ts'o
2018-05-11 12:41 ` Dmitry Safonov
2018-05-16 15:46 ` Dmitry Safonov
2018-05-16 20:54 ` Theodore Y. Ts'o
2018-05-16 22:11 ` Dmitry Safonov
2018-05-10 12:52 ` [PATCH 2/2] lib/ratelimit: Lockless ratelimiting Dmitry Safonov
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=1525981807.28243.9.camel@arista.com \
--to=dima@arista.com \
--cc=0x7f454c46@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
--subject='Re: [PATCH 1/2] random: Omit double-printing ratelimit messages' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).