[PATCH v6 7/7] net: Suppress the "Comparison to NULL could be written" warnings

2016-09-29 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 32 net/sctp/proc.c | 2 +- 2 files changed, 17 insertions(+), 17 de

[PATCH v6 1/7] net:snmp: Introduce generic interfaces for snmp_get_cpu_field{,64}

2016-09-29 Thread Jia He
This is to introduce the generic interfaces for snmp_get_cpu_field{,64}. It exchanges the two for-loops for collecting the percpu statistics data. This can aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> Suggested-by: M

[PATCH v6 5/7] proc: Reduce cache miss in xfrm_statistics_seq_show

2016-09-29 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[PATCH v6 4/7] proc: Reduce cache miss in sctp_snmp_seq_show

2016-09-29 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ne

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

2016-09-29 Thread Jia He
This is to use the generic interfaces 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 <hejia...@gmail.

[PATCH v6 3/7] proc: Reduce cache miss in snmp6_seq_show

2016-09-29 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 30 ++ 1 file changed, 22 insertions(+), 8 del

[PATCH v6 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-09-29 Thread Jia He
The parameter items(is always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2f1f5d4..3

[PATCH v6 0/7] Reduce cache miss for snmp_fold_field

2016-09-29 Thread Jia He
eq_show considerred the stack usage is too large v3: - introduce generic interface (suggested by Marcelo Ricardo Leitner) - use max_t instead of self defined macro (suggested by David Miller) v2: - fix bug in udplite statistics. - snmp_seq_show is split into 2 parts Jia He (7): net:snmp: Introduce

[PATCH v5 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-09-28 Thread Jia He
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2f1f5d4..3

[PATCH v5 5/7] proc: Reduce cache miss in xfrm_statistics_seq_show

2016-09-28 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff

[PATCH v5 1/7] net:snmp: Introduce generic interfaces for snmp_get_cpu_field{,64}

2016-09-28 Thread Jia He
This is to introduce the generic interfaces for snmp_get_cpu_field{,64}. It exchanges the two for-loops for collecting the percpu statistics data. This can aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> Suggested-by: M

[PATCH v5 3/7] proc: Reduce cache miss in snmp6_seq_show

2016-09-28 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 32 +++- 1 file changed, 23 insertions(+), 9 del

[PATCH v5 7/7] net: Suppress the "Comparison to NULL could be written" warnings

2016-09-28 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 32 net/sctp/proc.c | 2 +- 2 files changed, 17 insertions(+), 17 de

[PATCH v5 4/7] proc: Reduce cache miss in sctp_snmp_seq_show

2016-09-28 Thread Jia He
This is to use the generic interfaces snmp_get_cpu_field{,64}_batch to aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH v5 0/7] Reduce cache miss for snmp_fold_field

2016-09-28 Thread Jia He
nsiderred the stack usage is too large v3: - introduce generic interface (suggested by Marcelo Ricardo Leitner) - use max_t instead of self defined macro (suggested by David Miller) v2: - fix bug in udplite statistics. - snmp_seq_show is split into 2 parts Jia He (7): net:snmp: Introduce generic interfaces

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

2016-09-28 Thread Jia He
This is to use the generic interfaces 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 <hejia...@gmail.

[PATCH v4 0/7] Reduce cache miss for snmp_fold_field

2016-09-26 Thread Jia He
cardo Leitner) - use max_t instead of self defined macro (suggested by David Miller) v2: - fix bug in udplite statistics. - snmp_seq_show is split into 2 parts Jia He (7): net:snmp: Introduce generic interfaces for snmp_get_cpu_field{,64} proc: Reduce cache miss in snmp_seq_show proc: Reduce cache m

[PATCH v4 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-09-26 Thread Jia He
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 2f1f5d4..3

[PATCH v4 5/7] proc: Reduce cache miss in xfrm_statistics_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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[PATCH v4 4/7] proc: Reduce cache miss in sctp_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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ne

[PATCH v4 3/7] proc: Reduce cache miss in snmp6_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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 32 +++- 1 file changed, 23 insertions(+), 9 del

[PATCH v4 7/7] net: Suppress the "Comparison to NULL could be written" warnings

2016-09-26 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 32 net/sctp/proc.c | 2 +- 2 files changed, 17 insertions(+), 17 de

[PATCH v4 1/7] net:snmp: Introduce generic interfaces for snmp_get_cpu_field{,64}

2016-09-26 Thread Jia He
This is to introduce the generic interfaces for snmp_get_cpu_field{,64}. It exchanges the two for-loops for collecting the percpu statistics data. This can aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> Suggested-by: M

[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 <hejia...@gmail.

[RFC PATCH v3 0/7] Reduce cache miss for snmp_fold_field

2016-09-09 Thread Jia He
] 6.868422769 seconds time elapsed The cache-miss rate can be reduced from 15% to 2.9% v3: - introduce generic interface (suggested by Marcelo Ricardo Leitner) - use max_t instead of self defined macro (suggested by David Miller) v2: - fix bug in udplite statistics. - snmp_seq_show is

[RFC PATCH v3 7/7] net: Suppress the "Comparison to NULL could be written" warning

2016-09-09 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 32 net/sctp/proc.c | 2 +- 2 files changed, 17 insertions(+), 17 de

[RFC PATCH v3 3/7] proc: Reduce cache miss in snmp6_seq_show

2016-09-09 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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 32 +++- 1 file changed, 23 insertions(+), 9 del

[RFC PATCH v3 6/7] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-09-09 Thread Jia He
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f418d2e..e

[RFC PATCH v3 2/7] proc: Reduce cache miss in {snmp,netstat}_seq_show

2016-09-09 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 and netstat_seq_show are split into 2 parts to avoid build warning "the frame size" larger than 1024 on s390. Signed-off-

[RFC PATCH v3 5/7] proc: Reduce cache miss in xfrm_statistics_seq_show

2016-09-09 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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[RFC PATCH v3 4/7] proc: Reduce cache miss in sctp_snmp_seq_show

2016-09-09 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. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ne

[RFC PATCH v3 1/7] net:snmp: Introduce generic batch interfaces for snmp_get_cpu_field{,64}

2016-09-09 Thread Jia He
This is to introduced the generic batch interfaces for snmp_get_cpu_field{,64}. It exchanges the two for-loops for collecting the percpu statistics data. This can aggregate the data by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> Sug

[RFC PATCH v2 6/6] net: Suppress the "Comparison to NULL could be written" warning

2016-09-05 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 44 ++-- net/sctp/proc.c | 4 ++-- net/xfrm/

[RFC PATCH v2 3/6] proc: Reduce cache miss in sctp_snmp_seq_show

2016-09-05 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 13 ++--- 1 file changed, 10 insertions(+), 3 del

[RFC PATCH v2 1/6] proc: Reduce cache miss in {snmp,netstat}_seq_show

2016-09-05 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can 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

[RFC PATCH v2 5/6] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-09-05 Thread Jia He
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f418d2e..e

[RFC PATCH v2 4/6] proc: Reduce cache miss in xfrm_statistics_seq_show

2016-09-05 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 17 + 1 file changed, 13 insertions

[RFC PATCH v2 2/6] proc: Reduce cache miss in snmp6_seq_show

2016-09-05 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 47 --- 1 file c

[RFC PATCH v2 0/6] Reduce cache miss for snmp_fold_field

2016-09-05 Thread Jia He
] 6.868422769 seconds time elapsed The cache-miss rate can be reduced from 15% to 2.9% v2: - 1/6 fix bug in udplite statistics. - 1/6 snmp_seq_show is split into 2 parts Jia He (6): proc: Reduce cache miss in {snmp,netstat}_seq_show proc: Reduce cache miss in snmp6_seq_show pro

[RFC PATCH 5/6] ipv6: Remove useless parameter in __snmp6_fill_statsdev

2016-08-29 Thread Jia He
The parameter items(always ICMP6_MIB_MAX) is useless for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/addrconf.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index df8425f..0

[RFC PATCH 2/6] proc: Reduce cache miss in snmp6_seq_show

2016-08-29 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv6/proc.c | 47 --- 1 file c

[RFC PATCH 1/6] proc: Reduce cache miss in {snmp,netstat}_seq_show

2016-08-29 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can aggregate the data by going through all the items of each cpu sequentially. In snmp_seq_show, just use one buff copy to dislay the Udp and UdpLite data because they are the same. Signed-off-by: Jia He <he

[RFC PATCH 3/6] proc: Reduce cache miss in sctp_snmp_seq_show

2016-08-29 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/sctp/proc.c | 13 ++--- 1 file changed, 10 insertions(+), 3 del

[RFC PATCH 0/6] Reduce cache miss for snmp_fold_field

2016-08-29 Thread Jia He
%] 464466 LLC-load-misses #0.25% of all LL-cache hits[39.89%] 6.868422769 seconds time elapsed The cache-miss rate can be reduced from 15% to 2.9% Jia He (6): proc: Reduce cache miss in {snmp,netstat}_seq_show proc: Reduce cache miss in snmp6_seq_show pro

[RFC PATCH 4/6] proc: Reduce cache miss in xfrm_statistics_seq_show

2016-08-29 Thread Jia He
This patch exchanges the two loop for collecting the percpu statistics data. This can reduce cache misses by going through all the items of each cpu sequentially. Signed-off-by: Jia He <hejia...@gmail.com> --- net/xfrm/xfrm_proc.c | 17 + 1 file changed, 13 insertions

[RFC PATCH 6/6] net: Suppress the "Comparison to NULL

2016-08-29 Thread Jia He
This is to suppress the checkpatch.pl warning "Comparison to NULL could be written". No functional changes here. Signed-off-by: Jia He <hejia...@gmail.com> --- net/ipv4/proc.c | 42 +- net/sctp/proc.c | 4 ++-- net/xfrm/xfrm_pro

[RFC PATCH 3/3] net: Remove the useless parameter of __snmp6_fill_statsdev

2016-08-08 Thread Jia He
In commit a3a773726c9f ("net: Optimize snmp stat aggregation by walking all the percpu data at once"), __snmp6_fill_stats64 had been optimized by removing parameter items, so do the same for __snmp6_fill_statsdev. Signed-off-by: Jia He <hejia...@gmail.com> Cc: "

[RFC PATCH 2/3] net: Replace for_each_possible_cpu with for_each_online_cpu

2016-08-08 Thread Jia He
In PowerPC server with large number cpus, the loop index in smt=1 could be reduced to 1/8 compared with smt=8. Thus cache misses can be reduced. Signed-off-by: Jia He <hejia...@gmail.com> Cc: "David S. Miller" <da...@davemloft.net> Cc: Alexey Kuznetsov <kuz...@ms2.in

[RFC PATCH 0/3] net: Improve snmp6_fill_stats

2016-08-08 Thread Jia He
This is the follow up work of commit a3a773726c9f ("net: Optimize snmp stat aggregation by walking all the percpu data at once") Jia He (3): net: Remove unnecessary memset in __snmp6_fill_stats64 net: Replace for_each_possible_cpu with for_each_online_cpu net: Remove the useless

[RFC PATCH 1/3] net: Remove unnecessary memset in __snmp6_fill_stats64

2016-08-08 Thread Jia He
buff[] will be assigned later, so memset is not necessary. Signed-off-by: Jia He <hejia...@gmail.com> Cc: "David S. Miller" <da...@davemloft.net> Cc: Alexey Kuznetsov <kuz...@ms2.inr.ac.ru> Cc: James Morris <jmor...@namei.org> Cc: Hideaki YOSHIFUJI <yoshf..