]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: reduce percpu needs for icmpmsg mibs
authorEric Dumazet <eric.dumazet@gmail.com>
Tue, 8 Nov 2011 13:04:43 +0000 (13:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Nov 2011 21:04:20 +0000 (16:04 -0500)
commitf6b6ecc3103e8c16546d459661e2c8962e7ac75d
treeb5c1d6d5575a7b75c7c816e0809690f58401715c
parent78b26376c1812cbfd13240ad196a60f296b52394
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>
include/net/icmp.h
include/net/netns/mib.h
include/net/snmp.h
net/ipv4/af_inet.c
net/ipv4/proc.c