Re: [PATCH v4 2/7] proc: Reduce cache miss in snmp_seq_show

2016-09-27 Thread David Miller
From: Jia He Date: Mon, 26 Sep 2016 16:09:10 +0800 > +static int snmp_seq_show_tcp_udp(struct seq_file *seq, void *v) > +{ > + int i; > + unsigned long buff[TCPUDP_MIB_MAX]; > + struct net *net = seq->private; Please always order local variables from longest to shortest line. Please

[PATCH v4 2/7] proc: Reduce cache miss in snmp_seq_show

2016-09-26 Thread Jia He
This is to use the generic interface snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Then snmp_seq_show is split into 2 parts to avoid build warning "the frame size" larger than 1024. Signed-off-by: Jia He --- net/ipv4/proc.c | 68