From patchwork Wed Mar 31 17:52:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 12175877 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D825C43462 for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FC8E60FDA for ; Wed, 31 Mar 2021 17:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbhCaRw4 (ORCPT ); Wed, 31 Mar 2021 13:52:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbhCaRwU (ORCPT ); Wed, 31 Mar 2021 13:52:20 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4ADC061574 for ; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id y2so8291330plg.5 for ; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8UO2Ozxm1SXKOD6S8TvYVA153uE4XwXKbER1KSQTCbM=; b=r6rBG+8YeWAzuMBEQDW9nxNelToIFlTtA8smGIROx9TXxCOu3qTcEjjMMY3x8nbhVu rhHbqsvozpQD59H3agUAozaHg+1vVKCuR1Ls8hSmAH/AcslKtyfrXsZ/KuZ9uqLqDTc1 b2RJmToADVg4ybtLcZp6mWq1amwymG1CXYCDgCAOqDSPtQzaMpLqN9PPYmyfXakROWcC 7lLdZS9PZQjgznDTNM49wSqdR3wnD1IyC/kiSKN+49c+PVizVtq23TxwwGyR4YkqLFV3 UFNbW3OqMwtc8LpZN3kdg+Yk5mNjsO2XnomXJ9l/dq5S/3t0PooSedoA71VxmBtpUWGh lnvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8UO2Ozxm1SXKOD6S8TvYVA153uE4XwXKbER1KSQTCbM=; b=WMDDgfFhzfE3eRXzMNMDb1dwcxrQSy9syrJ0/RMCajeRoAxAAmUZx4xLQXgl5qpozB lSb7jxsLuUqarOBfv1mwvntvuN/SQKAn0Wu/1MH8J3AWciovlZXXgqRrzTTORL10ZWL7 Qcw2QFpk9IZNtIuLSuytxf+lRhF+Uq0ASuGLQ4I2fkLcTntvIHKYXuGsjo2ltEqTstvz LrUD8VrX4MFAn9XIIjQQzP0oFLvDSo7AizkFQgCP+ri7wSCnsEbsRi3zK973cQsoSQMb 8EdSACEOrJeVoK/32xh8QeA1X/f/675hYJ+6JmQPHOPeS9QK7FHrRKR1v0Mz8TCF8H13 S6Lg== X-Gm-Message-State: AOAM5330vFBe2sRhYod3pqa2GJSE/iY4QeKtGKcrxm1BkXqyWZkqzxio 2a7YMOWdWg7aEONKlMAQqUA= X-Google-Smtp-Source: ABdhPJxptNEjIbqvQ71NnFYMm0lMLU5fBIXc7Xue+KhYkeO1Dq5l7tNrOQDf4Hm/EtcW9vIb+F3vhA== X-Received: by 2002:a17:90a:bd09:: with SMTP id y9mr4501105pjr.179.1617213140074; Wed, 31 Mar 2021 10:52:20 -0700 (PDT) Received: from edumazet1.svl.corp.google.com ([2620:15c:2c4:201:9107:b184:4a71:45d0]) by smtp.gmail.com with ESMTPSA id q17sm3319028pfq.171.2021.03.31.10.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Mar 2021 10:52:19 -0700 (PDT) From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski Cc: netdev , Eric Dumazet , Eric Dumazet Subject: [PATCH net-next 2/9] inet: shrink netns_ipv4 by another cache line Date: Wed, 31 Mar 2021 10:52:06 -0700 Message-Id: <20210331175213.691460-3-eric.dumazet@gmail.com> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210331175213.691460-1-eric.dumazet@gmail.com> References: <20210331175213.691460-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Eric Dumazet By shuffling around some fields to remove 8 bytes of hole, we can save one cache line. pahole result before/after the patch : /* size: 768, cachelines: 12, members: 139 */ /* sum members: 673, holes: 11, sum holes: 39 */ /* padding: 56 */ /* paddings: 2, sum paddings: 7 */ /* forced alignments: 1 */ -> /* size: 704, cachelines: 11, members: 139 */ /* sum members: 673, holes: 10, sum holes: 31 */ /* paddings: 2, sum paddings: 7 */ /* forced alignments: 1 */ Signed-off-by: Eric Dumazet --- include/net/netns/ipv4.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 1085ed4e0788d7cd432dfc7e5604ef3cd66dc337..538ed69919dc4d51acfd43c7d6d1fca611fcb003 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -57,17 +57,17 @@ struct netns_ipv4 { struct mutex ra_mutex; #ifdef CONFIG_IP_MULTIPLE_TABLES struct fib_rules_ops *rules_ops; - bool fib_has_custom_rules; - unsigned int fib_rules_require_fldissect; struct fib_table __rcu *fib_main; struct fib_table __rcu *fib_default; + unsigned int fib_rules_require_fldissect; + bool fib_has_custom_rules; #endif bool fib_has_custom_local_routes; + bool fib_offload_disabled; #ifdef CONFIG_IP_ROUTE_CLASSID int fib_num_tclassid_users; #endif struct hlist_head *fib_table_hash; - bool fib_offload_disabled; struct sock *fibnl; struct sock * __percpu *icmp_sk;