[Intel-wired-lan] [PATCH 0/3 net-next] Bring sizeof(net_device) down to < 2K bytes

Thomas Graf tgraf at suug.ch
Fri Apr 10 08:41:34 UTC 2015


On 04/09/15 at 05:01pm, Alexei Starovoitov wrote:
> On Fri, Apr 10, 2015 at 01:43:25AM +0200, Thomas Graf wrote:
> > The size of struct net_device crossed the 2K boundary a while ago which
> > is a waste in combination with many net namespaces. This series brings
> > the size of struct net_device down to well below 2K in total size with
> > a typical configuration. Some reserves a several holes leave room for
> > further expansion.
> 
> Great stuff!
> Can you share what was the sizeof(struct net_device) with typical
> x86 config before and after?

Before:

/* BRAIN FART ALERT! 2176 != 2091 + 41(holes), diff = 44 */

After:

/* size: 1984, cachelines: 31, members: 121 */
/* sum members: 1947, holes: 6, sum holes: 33 */
/* padding: 8 */
/* paddings: 2, sum paddings: 11 */

/* BRAIN FART ALERT! 1984 != 1947 + 33(holes), diff = 4 */


More information about the Intel-wired-lan mailing list