From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: Steve.Hawkes@motorola.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: printk_ratelimit and net_ratelimit conflict and tunable behavior
Date: Wed, 20 Feb 2008 23:00:46 -0800 [thread overview]
Message-ID: <1203577246.7181.241.camel@localhost> (raw)
In-Reply-To: <20080220.223219.165157596.davem@davemloft.net>
On Wed, 2008-02-20 at 22:32 -0800, David Miller wrote:
> > + if (lost) {
> > + printk(KERN_WARNING
> > + "printk: %d %s%smessage%s suppressed.\n",
> > + lost,
> > + (state->facility == 0 ? "" :
> > state->facility),
> > + (state->facility == 0 ? "" : " "),
> > + (lost > 1 ? "s" : ""));
> > + }
> > return 1;
> > }
This compares a pointer to 0.
How about something like:
if (lost)
pr_warn("printk: %s suppressed message count: %d\n",
state->facility ? : "ratelimit", lost);
> > - missed++;
> > + state->missed++;
> > spin_unlock_irqrestore(&ratelimit_lock, flags);
> > return 0;
> > }
> > @@ -1280,8 +1290,18 @@ int printk_ratelimit_burst = 10;
> >
> > int printk_ratelimit(void)
> > {
> > + static struct printk_ratelimit_state limit_state = {
> > + .toks = 10 * 5 * HZ,
> > + .last_jiffies = 0,
> > + .missed = 0,
> > + .limit_jiffies = 5 * HZ,
> > + .limit_burst = 10,
> > + .facility = 0
> > + };
> > +
.facility = NULL
next prev parent reply other threads:[~2008-02-21 7:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 21:30 printk_ratelimit and net_ratelimit conflict and tunable behavior Hawkes Steve-FSH016
2008-02-21 6:32 ` David Miller
2008-02-21 7:00 ` Joe Perches [this message]
2008-02-25 15:47 ` Hawkes Steve-FSH016
2008-02-25 20:02 ` David Miller
2008-02-25 20:13 ` Joe Perches
[not found] ` <7BFDACCD6948EF4D8FE8F4888A91596A016371FE@tx14exm60.ds.mot.com>
2008-02-26 0:04 ` Joe Perches
-- strict thread matches above, loose matches on Subject: below --
2008-02-25 20:36 Steven Hawkes
2008-02-25 23:45 ` Andrew Morton
2008-02-28 16:19 ` Hawkes Steve-FSH016
2008-02-28 18:39 ` Andrew Morton
2008-02-28 16:10 Steven Hawkes
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=1203577246.7181.241.camel@localhost \
--to=joe@perches.com \
--cc=Steve.Hawkes@motorola.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.