From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH v3 17/30] inet: frags: reorganize struct netns_frags Date: Thu, 13 Sep 2018 07:58:49 -0700 Message-ID: <20180913145902.17531-18-sthemmin@microsoft.com> References: <20180913145902.17531-1-sthemmin@microsoft.com> Cc: netdev@vger.kernel.org, stable@vger.kernel.org, edumazet@google.com To: davem@davemloft.net, gregkh@linuxfoundation.org Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:45444 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728071AbeIMUJZ (ORCPT ); Thu, 13 Sep 2018 16:09:25 -0400 Received: by mail-pf1-f196.google.com with SMTP id i26-v6so2778094pfo.12 for ; Thu, 13 Sep 2018 07:59:33 -0700 (PDT) In-Reply-To: <20180913145902.17531-1-sthemmin@microsoft.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Put the read-mostly fields in a separate cache line at the beginning of struct netns_frags, to reduce false sharing noticed in inet_frag_kill() Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller (cherry picked from commit c2615cf5a761b32bf74e85bddc223dfff3d9b9f0) --- include/net/inet_frag.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index a52e7273e7a5..ed07e3786d98 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -5,16 +5,17 @@ #include struct netns_frags { - struct rhashtable rhashtable ____cacheline_aligned_in_smp; - - /* Keep atomic mem on separate cachelines in structs that include it */ - atomic_long_t mem ____cacheline_aligned_in_smp; /* sysctls */ long high_thresh; long low_thresh; int timeout; int max_dist; struct inet_frags *f; + + struct rhashtable rhashtable ____cacheline_aligned_in_smp; + + /* Keep atomic mem on separate cachelines in structs that include it */ + atomic_long_t mem ____cacheline_aligned_in_smp; }; /** -- 2.18.0