[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1525981807.28243.9.camel@arista.com>
Date: Thu, 10 May 2018 20:50:07 +0100
From: Dmitry Safonov <dima@...sta.com>
To: "Theodore Y. Ts'o" <tytso@....edu>
Cc: linux-kernel@...r.kernel.org, 0x7f454c46@...il.com,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 1/2] random: Omit double-printing ratelimit messages
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
Powered by blists - more mailing lists