net: proc: speedup /proc/net/netstat
authorEric Dumazet <edumazet@google.com>
Thu, 28 Jan 2021 16:21:45 +0000 (08:21 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 30 Jan 2021 04:59:53 +0000 (20:59 -0800)
commit0d6cd689f9ba47deffffe9dfd204843ce8f1a51e
tree3e5c70083f679eb9054fa4f4d8ff2aa026ea278b
parentdf610cd9163b90adc3b5c23868089a0349580551
net: proc: speedup /proc/net/netstat

Use cache friendly helpers to better use cpu caches
while reading /proc/net/netstat

Tested on a platform with 256 threads (AMD Rome)

Before: 305 usec spent in netstat_seq_show()
After: 130 usec spent in netstat_seq_show()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20210128162145.1703601-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/proc.c