Commit 9829f0a5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] printk_ratelimit() tweaks

From: Anton Blanchard <anton@samba.org>

I made a few changes, basically the burst parameter is now in units of
messages, makes much more sense than the old net ratelimit one.

I also screwed up adding a sysctl_jiffies strategy for the burst parameter.
parent a22c1627
...@@ -254,8 +254,8 @@ the different loglevels. ...@@ -254,8 +254,8 @@ the different loglevels.
printk_ratelimit: printk_ratelimit:
Some warning messages are rate limited. printk_ratelimit specifies Some warning messages are rate limited. printk_ratelimit specifies
the minimum length of time between these messages, by default we the minimum length of time between these messages (in jiffies), by
allow one every 5 seconds. default we allow one every 5 seconds.
A value of 0 will disable rate limiting. A value of 0 will disable rate limiting.
......
...@@ -598,7 +598,6 @@ static ctl_table kern_table[] = { ...@@ -598,7 +598,6 @@ static ctl_table kern_table[] = {
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = &proc_dointvec,
.strategy = &sysctl_jiffies,
}, },
{ .ctl_name = 0 } { .ctl_name = 0 }
}; };
......
...@@ -155,8 +155,7 @@ ctl_table core_table[] = { ...@@ -155,8 +155,7 @@ ctl_table core_table[] = {
.data = &net_msg_burst, .data = &net_msg_burst,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_jiffies, .proc_handler = &proc_dointvec,
.strategy = &sysctl_jiffies,
}, },
{ {
.ctl_name = NET_CORE_OPTMEM_MAX, .ctl_name = NET_CORE_OPTMEM_MAX,
......
...@@ -38,7 +38,7 @@ void net_srandom(unsigned long entropy) ...@@ -38,7 +38,7 @@ void net_srandom(unsigned long entropy)
} }
int net_msg_cost = 5*HZ; int net_msg_cost = 5*HZ;
int net_msg_burst = 10*5*HZ; int net_msg_burst = 10;
/* /*
* This enforces a rate limit: not more than one kernel message * This enforces a rate limit: not more than one kernel message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment