public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: [B.A.T.M.A.N.] [RFC] batman-adv: Reorder structs to reduce	padding
Date: Fri, 16 Nov 2012 20:17:14 +0100	[thread overview]
Message-ID: <2584311.tkU79LDNzZ@bentobox> (raw)
In-Reply-To: <201211060258.54459.lindner_marek@yahoo.de>

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

On Monday 05 November 2012 19:58:54 Marek Lindner wrote:
> On Sunday, November 04, 2012 06:41:48 Sven Eckelmann wrote:
> > -       struct batadv_neigh_node __rcu *router; /* rcu protected pointer
> > */
> > 
> >  #ifdef CONFIG_BATMAN_ADV_DAT
> >  
> >         batadv_dat_addr_t dat_addr;
> >  
> >  #endif
> > 
> > +       uint8_t flags;
> > +       uint8_t gw_flags;
> > +       struct batadv_neigh_node __rcu *router; /* rcu protected pointer
> > */
> 
> Shouldn't we move batadv_dat_addr_t to the end of the struct to achieve the
> smallest possible struct regardless of whether DAT is compiled in or not ?
> Or does it have no effect ?

More or less. It is hard to optimize it for both situation. Just moving to the 
end will not fix the problem because it will create an 1 byte whole which has 
to filled using something else. And optimizing it for all architectures is 
even harder.

But this RFC is not really important. It was just a small fun test of pahole 
for me.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2012-11-16 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-03 22:41 [B.A.T.M.A.N.] [RFC] batman-adv: Reorder structs to reduce padding Sven Eckelmann
2012-11-05 18:58 ` Marek Lindner
2012-11-16 19:17   ` Sven Eckelmann [this message]

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=2584311.tkU79LDNzZ@bentobox \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=lindner_marek@yahoo.de \
    /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