netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, dccp@vger.kernel.org
Subject: Re: [PATCH 6/6] [TCP]: Reorganize struct tcp_sock to save 16 bytes on 64-bit arch
Date: Thu, 31 Jan 2008 18:17:20 -0200	[thread overview]
Message-ID: <20080131201720.GE11940@ghostprotocols.net> (raw)
In-Reply-To: <47A22841.6090508@cosmosbay.com>

Em Thu, Jan 31, 2008 at 08:57:53PM +0100, Eric Dumazet escreveu:
> Arnaldo Carvalho de Melo a écrit :
>> /home/acme/git/net-2.6/net/ipv6/tcp_ipv6.c:
>>   struct tcp_sock  |  -16
>>   struct tcp6_sock |  -16
>>  2 structs changed
>>
>> Now it is at:
>>
>> /* size: 1552, cachelines: 25 */
>> /* paddings: 2, sum paddings: 8 */
>> /* last cacheline: 16 bytes */
>>
>> As soon as we stop using skb_queue_list we'll get it down to 24 cachelines.
>>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> ---
>>  include/linux/tcp.h |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
>> index 08027f1..f48644d 100644
>> --- a/include/linux/tcp.h
>> +++ b/include/linux/tcp.h
>> @@ -304,7 +304,6 @@ struct tcp_sock {
>>  	u32	rtt_seq;	/* sequence number to update rttvar	*/
>>   	u32	packets_out;	/* Packets which are "in flight"	*/
>> -	u32	retrans_out;	/* Retransmitted packets out		*/
>>  /*
>>   *      Options received (usually on last packet, some only on SYN packets).
>>   */
>> @@ -332,6 +331,8 @@ struct tcp_sock {
>>   	struct tcp_sack_block recv_sack_cache[4];
>>  +	u32	retrans_out;	/* Retransmitted packets out		*/
>> +
>
> Hum... retrans_out should sit close to packets_out (or lost_out/sacked_out 
> ???), please.
>
> 'struct tcp_sock' is very large on 64 bits, so I would prefer to make sure 
> most paths dont need to touch all 24 cache lines (or 25 cache lines).

That is perfectly fine, I'll replace my patch with another, that states
this beyond doubt.

- Arnaldo

  reply	other threads:[~2008-01-31 20:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 18:31 [PATCHES 0/6]: Move hashinfo to sk_prot and struct reorgs Arnaldo Carvalho de Melo
2008-01-31 18:31 ` [PATCH 1/6] [SOCK] proto: Add hashinfo member to struct proto Arnaldo Carvalho de Melo
2008-01-31 18:31   ` [PATCH 2/6] [INET6]: Reorganize struct inet6_dev to save 8 bytes Arnaldo Carvalho de Melo
2008-01-31 18:31     ` [PATCH 3/6] [DCCP]: Reorganize struct dccp_sock " Arnaldo Carvalho de Melo
2008-01-31 18:31       ` [PATCH 4/6] [IPV6]: Reorganize strut ipv6_mc_socklist " Arnaldo Carvalho de Melo
2008-01-31 18:31         ` [PATCH 5/6] [INET_TIMEWAIT_SOCK]: Reorganize struct inet_timewait_sock to save some bytes Arnaldo Carvalho de Melo
2008-01-31 18:31           ` [PATCH 6/6] [TCP]: Reorganize struct tcp_sock to save 16 bytes on 64-bit arch Arnaldo Carvalho de Melo
2008-01-31 19:57             ` Eric Dumazet
2008-01-31 20:17               ` Arnaldo Carvalho de Melo [this message]
2008-01-31 20:33                 ` Arnaldo Carvalho de Melo
2008-02-01  2:40 ` [PATCHES 0/6]: Move hashinfo to sk_prot and struct reorgs David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080131201720.GE11940@ghostprotocols.net \
    --to=acme@redhat.com \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=dccp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).