From patchwork Fri Nov 23 13:08:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 201317 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 73B352C008C for ; Sat, 24 Nov 2012 00:11:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755012Ab2KWNKw (ORCPT ); Fri, 23 Nov 2012 08:10:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44737 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754871Ab2KWNKu (ORCPT ); Fri, 23 Nov 2012 08:10:50 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAND8C3f022320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Nov 2012 08:08:12 -0500 Received: from dragon.localdomain (ovpn-116-30.ams2.redhat.com [10.36.116.30]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAND8B84001556; Fri, 23 Nov 2012 08:08:12 -0500 Received: from [127.0.0.1] (localhost [IPv6:::1]) by dragon.localdomain (Postfix) with ESMTP id 797AAE404D7; Fri, 23 Nov 2012 14:08:11 +0100 (CET) From: Jesper Dangaard Brouer Subject: [RFC net-next PATCH V1 2/9] net: frag cache line adjust inet_frag_queue.net To: Eric Dumazet , "David S. Miller" , Florian Westphal Cc: Jesper Dangaard Brouer , netdev@vger.kernel.org, Pablo Neira Ayuso , Thomas Graf , Cong Wang , "Patrick McHardy" , "Paul E. McKenney" , Herbert Xu Date: Fri, 23 Nov 2012 14:08:11 +0100 Message-ID: <20121123130811.18764.21207.stgit@dragon> In-Reply-To: <20121123130749.18764.25962.stgit@dragon> References: <20121123130749.18764.25962.stgit@dragon> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In inet_frag_find() unfortunate cache-line bounces can occur with struct inet_frag_queue. As the net pointer (struct netns_frags) is placed on the same write-often cache-line as e.g. refcnt and lock. As the hash match check always check (q->net == nf). This (of-cause) only happens on hash bucket collisions, but as current hash size is only 64 this makes collisions more likely. Signed-off-by: Jesper Dangaard Brouer --- include/net/inet_frag.h | 2 +- 1 files changed, 1 insertions(+), 1 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/inet_frag.h b/include/net/inet_frag.h index 7b897b2..1f75316 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -14,7 +14,6 @@ struct netns_frags { struct inet_frag_queue { struct hlist_node list; - struct netns_frags *net; struct list_head lru_list; /* lru list member */ spinlock_t lock; atomic_t refcnt; @@ -24,6 +23,7 @@ struct inet_frag_queue { ktime_t stamp; int len; /* total length of orig datagram */ int meat; + struct netns_frags *net; u32 creation_ts;/* jiffies when queue was created*/ __u8 last_in; /* first/last segment arrived? */