From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753958Ab2LBRUS (ORCPT ); Sun, 2 Dec 2012 12:20:18 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:36999 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631Ab2LBRUQ (ORCPT ); Sun, 2 Dec 2012 12:20:16 -0500 Subject: Re: [PATCH RFC] [INET]: Get cirtical word in first 64bit of cache line From: Eric Dumazet To: Ling Ma Cc: linux-kernel@vger.kernel.org, netdev In-Reply-To: References: <1353900555-5966-1-git-send-email-ling.ma.program@gmail.com> <1353912241.30446.1257.camel@edumazet-glaptop> <1354024683.7553.1768.camel@edumazet-glaptop> Content-Type: text/plain; charset="UTF-8" Date: Sun, 02 Dec 2012 09:20:11 -0800 Message-ID: <1354468811.20109.566.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2012-12-02 at 21:25 +0800, Ling Ma wrote: > Hi Eric, > > Attached benchmark test-cwf.c(cc -o test-cwf test-cwf.c), the result > shows when last level cache(LLC) miss and CPU fetches data from > memory, critical word as first 64bit member in cache line has better > performance(costs 158290336 cycles ) than other positions(offset 0x10, > costs 164100732 ) in cache line, the performance is improved by 3.6% > in this case. > cpu-info is also involved too. > > Thanks > Ling Thanks Ling. Note that I was more interested by the case we read more fields per cache line, like we do in tcp lookups. (skc_daddr, skc_rcv_saddr, skc_bound_dev_if, skc_net). I made changes to net-next to prepare your patch. You'll have to move both skc_rxhash & skc_portpair before the skc_addrpair. I have to fix an endianness sparse problem, I'll send a patch for this in a separate thread right now.