From patchwork Wed Jul 31 02:48:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amerigo Wang X-Patchwork-Id: 263562 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C4F852C00DA for ; Wed, 31 Jul 2013 12:48:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179Ab3GaCsh (ORCPT ); Tue, 30 Jul 2013 22:48:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37532 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab3GaCsg (ORCPT ); Tue, 30 Jul 2013 22:48:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6V2mYnc032489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Jul 2013 22:48:34 -0400 Received: from localhost.localdomain (vpn1-114-211.nay.redhat.com [10.66.114.211]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6V2mUpv005932; Tue, 30 Jul 2013 22:48:31 -0400 From: Cong Wang To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Yuchung Cheng , Neal Cardwell , Cong Wang Subject: [Patch net-next] tcp_metrics: rearrange fields to avoid holes Date: Wed, 31 Jul 2013 10:48:25 +0800 Message-Id: <1375238905-6423-1-git-send-email-amwang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang On x86_64, before this patch: struct tcp_fastopen_metrics { u16 mss; /* 0 2 */ u16 syn_loss:10; /* 2: 6 2 */ /* XXX 6 bits hole, try to pack */ /* XXX 4 bytes hole, try to pack */ long unsigned int last_syn_loss; /* 8 8 */ struct tcp_fastopen_cookie cookie; /* 16 17 */ /* size: 40, cachelines: 1, members: 4 */ /* sum members: 29, holes: 1, sum holes: 4 */ /* bit holes: 1, sum bit holes: 6 bits */ /* padding: 7 */ /* last cacheline: 40 bytes */ }; after this patch: struct tcp_fastopen_metrics { u16 mss; /* 0 2 */ u16 syn_loss:10; /* 2: 6 2 */ /* XXX 6 bits hole, try to pack */ struct tcp_fastopen_cookie cookie; /* 4 17 */ /* XXX 3 bytes hole, try to pack */ long unsigned int last_syn_loss; /* 24 8 */ /* size: 32, cachelines: 1, members: 4 */ /* sum members: 29, holes: 1, sum holes: 3 */ /* bit holes: 1, sum bit holes: 6 bits */ /* last cacheline: 32 bytes */ }; On 32bit, the 4-byte hole should not exist, so this patch probably doesn't change anything. Cc: Eric Dumazet Cc: Yuchung Cheng Cc: Neal Cardwell Cc: David S. Miller Signed-off-by: Cong Wang --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 10b3796..438393f 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c @@ -25,8 +25,8 @@ int sysctl_tcp_nometrics_save __read_mostly; struct tcp_fastopen_metrics { u16 mss; u16 syn_loss:10; /* Recurring Fast Open SYN losses */ - unsigned long last_syn_loss; /* Last Fast Open SYN loss */ struct tcp_fastopen_cookie cookie; + unsigned long last_syn_loss; /* Last Fast Open SYN loss */ }; struct tcp_metrics_block {