lkml.org 
[lkml]   [2008]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk_ratelimit and net_ratelimit conflict and tunable behavior
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.



\
 
 \ /
  Last update: 2008-02-28 19:43    [W:0.371 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site