printk ratelimiting rewrite
All ratelimit user use same jiffies and burst params, so some messages (callbacks) will be lost. For example: a call printk_ratelimit(5 * HZ, 1) b call printk_ratelimit(5 * HZ, 1) before the 5*HZ timeout of a, then b will will be supressed. - rewrite __ratelimit, and use a ratelimit_state as parameter. Thanks for hints from andrew. - Add WARN_ON_RATELIMIT, update rcupreempt.h - remove __printk_ratelimit - use __ratelimit in net_ratelimit Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Cc: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
2711b793eb
commit
717115e1a5
@@ -67,7 +67,7 @@ static struct ctl_table net_core_table[] = {
|
||||
{
|
||||
.ctl_name = NET_CORE_MSG_COST,
|
||||
.procname = "message_cost",
|
||||
.data = &net_msg_cost,
|
||||
.data = &net_ratelimit_state.interval,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec_jiffies,
|
||||
@@ -76,7 +76,7 @@ static struct ctl_table net_core_table[] = {
|
||||
{
|
||||
.ctl_name = NET_CORE_MSG_BURST,
|
||||
.procname = "message_burst",
|
||||
.data = &net_msg_burst,
|
||||
.data = &net_ratelimit_state.burst,
|
||||
.maxlen = sizeof(int),
|
||||
.mode = 0644,
|
||||
.proc_handler = &proc_dointvec,
|
||||
|
Reference in New Issue
Block a user