Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once

From: David Miller
Date: Thu Aug 27 2015 - 14:38:29 EST


From: Raghavendra K T <raghavendra.kt@xxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Aug 2015 23:07:33 +0530

> @@ -4641,10 +4647,12 @@ static inline void __snmp6_fill_stats64(u64 *stats, void __percpu *mib,
> static void snmp6_fill_stats(u64 *stats, struct inet6_dev *idev, int attrtype,
> int bytes)
> {
> + u64 buff[IPSTATS_MIB_MAX] = {0,};
> +
> switch (attrtype) {
> case IFLA_INET6_STATS:
> - __snmp6_fill_stats64(stats, idev->stats.ipv6,

I would suggest using an explicit memset() here, it makes the overhead incurred
by this scheme clearer.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/