From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:44559 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727378AbeJJGJT (ORCPT ); Wed, 10 Oct 2018 02:09:19 -0400 From: Florian Fainelli To: netdev@vger.kernel.org Cc: davem@davemloft.net, gregkh@linuxfoundation.org, stable@vger.kernel.org, edumazet@google.com, sthemmin@microsoft.com Subject: [PATCH stable 4.9 16/29] inet: frags: reorganize struct netns_frags Date: Tue, 9 Oct 2018 15:49:11 -0700 Message-Id: <20181009224924.30151-17-f.fainelli@gmail.com> In-Reply-To: <20181009224924.30151-1-f.fainelli@gmail.com> References: <20181009224924.30151-1-f.fainelli@gmail.com> Sender: stable-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 dea175f3418a..f47678d2ccc2 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -4,16 +4,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.1