lkml.org 
[lkml]   [2015]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once
On 08/29/2015 08:56 AM, Eric Dumazet wrote:
> 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));

Thanks. Sure, will use this.

(I missed that. I thought that it was applicable only when we have
aligned data,and for power, put_aunaligned was not a nop unlike intel).

>
> Also please move buff[] array into __snmp6_fill_stats64() to make it
> clear it is used in a 'leaf' function.

Correct.

>
> (even if calling memcpy()/memset() makes it not a leaf function)
>



\
 
 \ /
  Last update: 2015-08-29 10:21    [W:0.278 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site