From patchwork Mon Oct 11 22:02:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 67487 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CFD10B70D1 for ; Tue, 12 Oct 2010 09:03:14 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756485Ab0JKWDJ (ORCPT ); Mon, 11 Oct 2010 18:03:09 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:45308 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756416Ab0JKWDH (ORCPT ); Mon, 11 Oct 2010 18:03:07 -0400 Received: by wwj40 with SMTP id 40so4256064wwj.1 for ; Mon, 11 Oct 2010 15:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=RgsiyqSOot319+Lp8cfcC+2Oep3b+kRpQ3sg5gTMIJo=; b=HTcHONTd/S76wAgAI3nmt5XNUNR/WxAz9/ccVaSTqmiW5EN4EPJAQ3dyCo3KuSETs1 sJmqobleUNxATliDYkoQyzovaSXSxijmr6kSup4r8PNuZFFcx1sJRCGk5Rp16pTUL49A vUFHtZG0ZP0k4nZPXxVfUoRfN78BFL0/lZZR4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=raX7Cp/6uv1QFt8tZ/ojJ9oJxdYDSE8MGhe7ZVk9+hviz2s2nj0IeD+g/yexHRnPiG iZF7l5e78hw6tFsmKtAlhmKKBcALCjtiIV3vuFARSxNL8Z7GkGPgkNQ5JahqBu0/i4nG wXPaSgKBP4d4NVjL9E/Pk7SQyPzT4WxJ02fhU= Received: by 10.227.135.16 with SMTP id l16mr6000128wbt.158.1286834586373; Mon, 11 Oct 2010 15:03:06 -0700 (PDT) Received: from [192.168.1.21] (167.144.72-86.rev.gaoland.net [86.72.144.167]) by mx.google.com with ESMTPS id g9sm6445065wbh.19.2010.10.11.15.03.04 (version=SSLv3 cipher=RC4-MD5); Mon, 11 Oct 2010 15:03:05 -0700 (PDT) Subject: [PATCH net-next] neigh: reorder struct neighbour fields From: Eric Dumazet To: David Miller Cc: netdev@vger.kernel.org In-Reply-To: <20101011.130128.245392712.davem@davemloft.net> References: <1286484247.3745.91.camel@edumazet-laptop> <20101011.121609.246536311.davem@davemloft.net> <1286826361.3218.14.camel@edumazet-laptop> <20101011.130128.245392712.davem@davemloft.net> Date: Tue, 12 Oct 2010 00:02:47 +0200 Message-ID: <1286834567.30423.102.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Here is the followup patch. Thanks ! [PATCH net-next] neigh: reorder struct neighbour fields (refcnt) and (ha_lock, ha, dev, output, ops, primary_key) should be placed on a separate cache lines. refcnt can be often written, while other fields are mostly read. This gave me good result on stress test : before: real 0m45.570s user 0m15.525s sys 9m56.669s After: real 0m41.841s user 0m15.261s sys 8m45.949s Signed-off-by: Eric Dumazet --- include/net/neighbour.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/net/neighbour.h b/include/net/neighbour.h index f04e7a2..822802a 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -94,7 +94,6 @@ struct neighbour { struct neighbour __rcu *next; struct neigh_table *tbl; struct neigh_parms *parms; - struct net_device *dev; unsigned long used; unsigned long confirmed; unsigned long updated; @@ -103,16 +102,17 @@ struct neighbour { __u8 type; __u8 dead; atomic_t refcnt; + struct sk_buff_head arp_queue; + struct timer_list timer; atomic_t probes; rwlock_t lock; seqlock_t ha_lock; unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; struct hh_cache *hh; int (*output)(struct sk_buff *skb); - struct sk_buff_head arp_queue; - struct timer_list timer; const struct neigh_ops *ops; struct rcu_head rcu; + struct net_device *dev; u8 primary_key[0]; };