Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once
From: Eric Dumazet
Date: Fri Aug 28 2015 - 23:26:54 EST
On Sat, 2015-08-29 at 08:27 +0530, Raghavendra K T wrote:
>
> /* Use put_unaligned() because stats may not be aligned for u64. */
> put_unaligned(items, &stats[0]);
> for (i = 1; i < items; i++)
> - put_unaligned(snmp_fold_field64(mib, i, syncpoff), &stats[i]);
> + put_unaligned(buff[i], &stats[i]);
>
I believe Joe suggested following code instead :
buff[0] = items;
memcpy(stats, buff, items * sizeof(u64));
Also please move buff[] array into __snmp6_fill_stats64() to make it
clear it is used in a 'leaf' function.
(even if calling memcpy()/memset() makes it not a leaf function)
--
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/