Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5037186rwd; Sun, 18 Jun 2023 04:21:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7DBvNFaDP0pSaY5j/L4bngSZzoSEk4snat4UYfvyYHXqM/3GUlQBVr8rdTAGLcf/ofsLEA X-Received: by 2002:a17:903:120f:b0:1b0:4c6c:716 with SMTP id l15-20020a170903120f00b001b04c6c0716mr16556062plh.4.1687087301392; Sun, 18 Jun 2023 04:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687087301; cv=none; d=google.com; s=arc-20160816; b=AnkjUR9S98v1OhKROr1JW5+HCIol67Z63gxi8fcgageob0ZsdSRWos7at17XuRKli1 iTyimD/Z1hJ6b1jWBkATiRhqTtoUIoieU2N7sWSgs0pLBFS4tMuOsuI1ZbVkr6ETPANz jTfrB9td8+EnAvUv6BB39TvovHy6vh5W80mzalEdL10HdDOvQpZGJhU2QE6l+Z4/Em9z wWh8ge6HhiMb4VYP4UOEbgqvwmZpkUDP9mHljUC5Y8vqVVBKxgAElNGW2TFFcYv/cAMB eoFunTimZ9sVIviW4CqlZKQDrYCYHB9GMxSbj9ndgdyadOYYxOi+q/PEWJioeYod6qZA eOFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=McAeXz2J4UO1BECLY75Q24ChR053II0UqATm+dnPZxw=; b=NPoYWBPt4alrkfVgCT0Xxra8o+/DuWbkCSK33cJV9wCj4N7qBctRfm6O7HTHs3sP1W m0iQTxCsAGEY7Z5I096zJ8U31pUIrdxBt/vmrIRImj09ekE9nNg3NQrq0JyX6DDW1+BK iuimpiSYgVxd6p3isWHNiJU9HWQjwAIxxMGZBzhNHD5fYVkvF/TqKJGpuGeGMQIJ0K9t d998MMXb+eyS9ZovuV76zy7BjFEep2ShLTDVatkZrFoLIXFiSPAfP1GlohAkuTnlo6mi 9ZQWLjBbLCBdJ0c2sQwwKzOTLrGntSXZ+fAFgBVZaFxe7ChIvpvo6lYkvoS3mPmKNgb8 8MDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=q67rMZnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a17090301c600b001b176dc95d4si12528315plh.557.2023.06.18.04.21.16; Sun, 18 Jun 2023 04:21:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=q67rMZnT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229590AbjFRJqx (ORCPT + 99 others); Sun, 18 Jun 2023 05:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjFRJqv (ORCPT ); Sun, 18 Jun 2023 05:46:51 -0400 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF91E10C4 for ; Sun, 18 Jun 2023 02:46:50 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id AozfqabYVEYhqAozfqlrwt; Sun, 18 Jun 2023 11:46:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1687081609; bh=McAeXz2J4UO1BECLY75Q24ChR053II0UqATm+dnPZxw=; h=From:To:Cc:Subject:Date; b=q67rMZnTDuv5OjLYdkOvp6ilJo6+ksdle57v4Zxzt272ZA4hRFtvynP0Ahhm2BKjp TRac47I8b6MwG85Lh25bHHwhWyECgazWwVDhqkilAFsspTUL3IfDCd9RNZQ4Fkt+6C OBVTMJnS3Vy4CGh+s7lbzC59py2LUrshOiGqL/VL50qmvQ6HuSLUaVOxwZ9kXfxr4A 3rnm68FSGkOhi/xF263vENFM0Pc+ERxijNH0XPAgN9+vwF6EcYqMcyJD7987/B9LqY +aWlIWBlE5UUx8WZaxSD5H9A+qCE4NqpsA76hl3X/SQT3H9lFjDBkRuZiIleVWEtR5 86mGZAHzlCuXQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 18 Jun 2023 11:46:49 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Matthieu Baerts , Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org, mptcp@lists.linux.dev Subject: [PATCH net-next] mptcp: Reorder fields in 'struct mptcp_pm_add_entry' Date: Sun, 18 Jun 2023 11:46:46 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Group some variables based on their sizes to reduce hole and avoid padding. On x86_64, this shrinks the size of 'struct mptcp_pm_add_entry' from 136 to 128 bytes. It saves a few bytes of memory and is more cache-line friendly. Signed-off-by: Christophe JAILLET --- Using pahole Before: ====== struct mptcp_pm_add_entry { struct list_head list; /* 0 16 */ struct mptcp_addr_info addr; /* 16 12 */ /* XXX 4 bytes hole, try to pack */ struct timer_list add_timer; /* 32 88 */ /* --- cacheline 1 boundary (64 bytes) was 56 bytes ago --- */ struct mptcp_sock * sock; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ u8 retrans_times; /* 128 1 */ /* size: 136, cachelines: 3, members: 5 */ /* sum members: 125, holes: 1, sum holes: 4 */ /* padding: 7 */ /* last cacheline: 8 bytes */ }; After: ===== struct mptcp_pm_add_entry { struct list_head list; /* 0 16 */ struct mptcp_addr_info addr; /* 16 12 */ u8 retrans_times; /* 28 1 */ /* XXX 3 bytes hole, try to pack */ struct timer_list add_timer; /* 32 88 */ /* --- cacheline 1 boundary (64 bytes) was 56 bytes ago --- */ struct mptcp_sock * sock; /* 120 8 */ /* size: 128, cachelines: 2, members: 5 */ /* sum members: 125, holes: 1, sum holes: 3 */ }; --- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index a12a87b780f6..a56718ffdd02 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -25,9 +25,9 @@ static int pm_nl_pernet_id; struct mptcp_pm_add_entry { struct list_head list; struct mptcp_addr_info addr; + u8 retrans_times; struct timer_list add_timer; struct mptcp_sock *sock; - u8 retrans_times; }; struct pm_nl_pernet { -- 2.34.1