ipv6: reduce percpu needs for icmpv6msg mibs
Reading /proc/net/snmp6 on a machine with a lot of cpus is very expensive (can be ~88000 us). This is because ICMPV6MSG MIB uses 4096 bytes per cpu, and folding values for all possible cpus can read 16 Mbytes of memory (32MBytes on non x86 arches) 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>
This commit is contained in:

committed by
David S. Miller

parent
3d249d4ca7
commit
2a24444f8f
@@ -84,7 +84,7 @@ struct icmpv6_mib_device {
|
||||
#define ICMP6MSG_MIB_MAX __ICMP6MSG_MIB_MAX
|
||||
/* per network ns counters */
|
||||
struct icmpv6msg_mib {
|
||||
unsigned long mibs[ICMP6MSG_MIB_MAX];
|
||||
atomic_long_t mibs[ICMP6MSG_MIB_MAX];
|
||||
};
|
||||
/* per device counters, (shared on all cpus) */
|
||||
struct icmpv6msg_mib_device {
|
||||
|
Reference in New Issue
Block a user