Subject: about : [NET]: Replace CONFIG_NET_DEBUG with sysctl.

From: Eric Dumazet <[email-masked]>
Date: Fri, 09 Mar 2007 07:34:15 +0100

Hello David and Stephen

I see git commit 8e2101a9faab43dcf307d46784a1ede7997fe729
and its potential problems :

Here on my x86_64 machine :

ffffffff806e7520 d rtnl_mutex
ffffffff806e7538 D net_msg_cost
ffffffff806e753c D net_msg_burst
ffffffff806e7540 D net_msg_warn
ffffffff806e7560 d lweventlist_lock

So net_msg_{cost|burst|warn} are on two 'heavy' cachelines.

I gently ask that any new sysctl is '__read_mostly' tagged.

After this patch applied, this looks much better :

ffffffff80725d20 d ifla_policy
ffffffff80725d68 D net_msg_cost
ffffffff80725d6c D net_msg_burst
ffffffff80725d70 D net_msg_warn
ffffffff80725d78 d flow_cachep
ffffffff80725d80 d nla_attr_minlen
ffffffff80725da0 d ctrl_policy

Thank you
Eric

[PATCH] NET : New sysctls should use __read_mostly tags

net_msg_warn should be placed in the read_mostly section, to avoid performance 
problems on SMP

Signed-off-by: Eric Dumazet <[email-masked]>
diff --git a/net/core/utils.c b/net/core/utils.c
index 34f0810..adecfd2 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -30,9 +30,9 @@ #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
-int net_msg_cost = 5*HZ;
-int net_msg_burst = 10;
-int net_msg_warn = 1;
+int net_msg_cost __read_mostly = 5*HZ;
+int net_msg_burst __read_mostly = 10;
+int net_msg_warn __read_mostly = 1;
 EXPORT_SYMBOL(net_msg_warn);
 
 /*