diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-11-08 14:04:43 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-09 22:04:20 +0100 |
commit | acb32ba3dee66d58704caeeb8c6ff95f60efdc66 (patch) | |
tree | b5c1d6d5575a7b75c7c816e0809690f58401715c /include/net/snmp.h | |
parent | net: rename sk_clone to sk_clone_lock (diff) | |
download | linux-acb32ba3dee66d58704caeeb8c6ff95f60efdc66.tar.xz linux-acb32ba3dee66d58704caeeb8c6ff95f60efdc66.zip |
ipv4: reduce percpu needs for icmpmsg mibs
Reading /proc/net/snmp on a machine with a lot of cpus is very expensive
(can be ~88000 us).
This is because ICMPMSG MIB uses 4096 bytes per cpu, and folding values
for all possible cpus can read 16 Mbytes of memory.
ICMP messages are not considered as fast path on a typical server, and
eventually few cpus handle them anyway. We can afford an atomic
operation instead of using percpu data.
This saves 4096 bytes per cpu and per network namespace.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/snmp.h')
-rw-r--r-- | include/net/snmp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h index 8f0f9ac0307f..0feafa68da01 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h @@ -67,7 +67,7 @@ struct icmp_mib { #define ICMPMSG_MIB_MAX __ICMPMSG_MIB_MAX struct icmpmsg_mib { - unsigned long mibs[ICMPMSG_MIB_MAX]; + atomic_long_t mibs[ICMPMSG_MIB_MAX]; }; /* ICMP6 (IPv6-ICMP) */ |