LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Hawkes Steve-FSH016" <Steve.Hawkes@motorola.com>
Cc: <davem@davemloft.net>, <joe@perches.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: printk_ratelimit and net_ratelimit conflict and tunable behavior
Date: Thu, 28 Feb 2008 10:39:55 -0800	[thread overview]
Message-ID: <20080228103955.570ade3e.akpm@linux-foundation.org> (raw)
In-Reply-To: <7BFDACCD6948EF4D8FE8F4888A91596A01637208@tx14exm60.ds.mot.com>

On Thu, 28 Feb 2008 10:19:02 -0600 "Hawkes Steve-FSH016" <Steve.Hawkes@motorola.com> wrote:

> Andrew Morton wrote:
> 
> > This patch causes a large and nasty reject.
> > Probably because you patched 2.6.24.  We're developing 2.6.25 now, and
> > the difference between the two is very large inded.  Please raise
> patches
> > against Linus's latest tree?
> 
> Will do. I'm learning the process. I assume Linus's latest tree is the
> one
> listed as the latest prepatch for the stable Linux kernel tree.

No, the stable tree is 2.6.24.  You'll want
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/snapshots/

> > >  int net_ratelimit(void)
> > >  {
> > > -	return __printk_ratelimit(net_msg_cost, net_msg_burst);
> > > +	static struct printk_ratelimit_state limit_state = {
> > > +		.toks          = 10 * 5 * HZ,
> > > +		.last_jiffies  = 0,
> > > +		.missed        = 0,
> > > +		.limit_jiffies = 5 * HZ,
> > > +		.limit_burst   = 10,
> > > +		.facility      = "net"
> > > +	};
> > > +
> > > +	return __printk_ratelimit(net_msg_cost, net_msg_burst,
> &limit_state);
> > 
> > I don't get it.  There's one instance of limit_state, kernel-wide, and
> > __printk_ratelimit() modifies it.  What prevents one CPU's activities
> from
> > interfering with a second CPU's activities?
> 
> The state is protected by the spinlock in __printk_ratelimit, like it is
> in
> the current kernel. Am I missing something?

ah, OK.

I've occasionally wondered if ratelimiting should be per-callsite rather
than kernel-wide, but I'm not aware of the present setup causing anyone any
problems.


  reply	other threads:[~2008-02-28 18:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-28 16:10 Steven Hawkes
2008-02-19 21:30 Hawkes Steve-FSH016
2008-02-21  6:32 ` David Miller
2008-02-21  7:00   ` Joe Perches
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

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=20080228103955.570ade3e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Steve.Hawkes@motorola.com \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: printk_ratelimit and net_ratelimit conflict and tunable behavior' \
    /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).