From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: [PATCH v4 net-next 16/19] inet: frags: reorganize struct netns_frags Date: Sat, 31 Mar 2018 12:58:57 -0700 Message-ID: <20180331195900.183604-17-edumazet@google.com> References: <20180331195900.183604-1-edumazet@google.com> Cc: netdev , Florian Westphal , Herbert Xu , Thomas Graf , Jesper Dangaard Brouer , Alexander Aring , Stefan Schmidt , Kirill Tkhai , Eric Dumazet , Eric Dumazet To: "David S . Miller" Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:42203 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbeCaT7w (ORCPT ); Sat, 31 Mar 2018 15:59:52 -0400 Received: by mail-pf0-f194.google.com with SMTP id o16so2092500pfk.9 for ; Sat, 31 Mar 2018 12:59:52 -0700 (PDT) In-Reply-To: <20180331195900.183604-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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 a52e7273e7a59bc8ce47b21d29235a740add8db0..ed07e3786d98614898bd5ec9804afb425ba82cec 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.17.0.rc1.321.gba9d0f2565-goog