From: Cong Wang <amwang@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org,
edumazet@google.com, ycheng@google.com, ncardwell@google.com
Subject: Re: [Patch net-next] tcp_metrics: rearrange fields to avoid holes
Date: Thu, 01 Aug 2013 10:48:31 +0800 [thread overview]
Message-ID: <1375325311.7780.9.camel@cr0> (raw)
In-Reply-To: <20130730.232639.178259761581407616.davem@davemloft.net>
On Tue, 2013-07-30 at 23:26 -0700, David Miller wrote:
> From: Cong Wang <amwang@redhat.com>
> Date: Wed, 31 Jul 2013 11:13:22 +0800
>
> > I know saving 8 bytes is not interesting for you, but it is for me,
> > since I need some room in struct tcp_metrics_block for union inet_addr.
> > With this patch, I don't have to make struct tcp_metrics_block expand to
> > 3 cachelines. :)
>
> Cong, please.
>
> Instead of making code accomodate an unnecessarily large "union
> inet_addr", make a small version of it that accomodates this use case
> and doesn't have the extra fields.
Please teach me how to do that?
The fields not used by inetpeer are sin_port and scope_id etc., and
sin_port is in the middle of sockaddr* structs.
Hmm, maybe just define a new struct by kicking the last field from
struct sockaddr_{in,in6}, so that we can at least shrink 4 bytes.
Except this, I have no idea how to do that.
Thanks!
next prev parent reply other threads:[~2013-08-01 2:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 2:48 [Patch net-next] tcp_metrics: rearrange fields to avoid holes Cong Wang
2013-07-31 3:08 ` Eric Dumazet
2013-07-31 3:13 ` Cong Wang
2013-07-31 3:24 ` Eric Dumazet
2013-07-31 3:35 ` Joe Perches
2013-07-31 3:40 ` Cong Wang
2013-07-31 3:37 ` Cong Wang
2013-07-31 3:57 ` Eric Dumazet
2013-07-31 6:26 ` David Miller
2013-08-01 2:48 ` Cong Wang [this message]
2013-08-01 7:15 ` David Miller
2013-08-01 8:13 ` Cong Wang
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=1375325311.7780.9.camel@cr0 \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@google.com \
/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).