Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494AbbH2Hvh (ORCPT ); Sat, 29 Aug 2015 03:51:37 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:42423 "EHLO e23smtp09.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752283AbbH2Hvf (ORCPT ); Sat, 29 Aug 2015 03:51:35 -0400 X-Helo: d23dlp03.au.ibm.com X-MailFrom: raghavendra.kt@linux.vnet.ibm.com X-RcptTo: netdev@vger.kernel.org Message-ID: <55E164C6.3000702@linux.vnet.ibm.com> Date: Sat, 29 Aug 2015 13:22:38 +0530 From: Raghavendra K T Organization: IBM User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Eric Dumazet CC: David Miller , edumazet@google.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, jiri@resnulli.us, hannes@stressinduktion.org, tom@herbertland.com, azhou@nicira.com, ebiederm@xmission.com, ipm@chirality.org.uk, nicolas.dichtel@6wind.com, serge.hallyn@canonical.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, anton@au1.ibm.com, nacc@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com Subject: Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once References: <1440610653-14210-3-git-send-email-raghavendra.kt@linux.vnet.ibm.com> <20150827.113823.214019265460582055.davem@davemloft.net> <55E00238.10909@linux.vnet.ibm.com> <20150828.112413.424099339331017970.davem@davemloft.net> <20150829025715.GA5546@linux.vnet.ibm.com> <1440818791.8932.128.camel@edumazet-glaptop2.roam.corp.google.com> In-Reply-To: <1440818791.8932.128.camel@edumazet-glaptop2.roam.corp.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15082907-0033-0000-0000-0000020877CC Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1102 Lines: 37 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) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/