From nobody Mon Feb 9 05:43:36 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EF0EEB64D8 for ; Sun, 18 Jun 2023 09:46:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjFRJqz (ORCPT ); Sun, 18 Jun 2023 05:46:55 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jiri Pirko Reviewed-by: Matthieu Baerts --- Using pahole Before: =3D=3D=3D=3D=3D=3D 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: =3D=3D=3D=3D=3D 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; }; =20 struct pm_nl_pernet { --=20 2.34.1