]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: make neigh_priv_len in struct net_device 16bit instead of 8bit
authorSebastian Siewior <bigeasy@linutronix.de>
Thu, 12 Dec 2013 09:15:59 +0000 (10:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Dec 2013 20:35:09 +0000 (15:35 -0500)
commita0a9663dd2146d54339237764e1bfc60e8a39328
treeba691d621e527466f5a2a3e47135f35948b167a1
parentf280e89ad6a29d9969cb6b216123c798e1689bc4
net: make neigh_priv_len in struct net_device 16bit instead of 8bit

neigh_priv_len is defined as u8. With all debug enabled struct
ipoib_neigh has 200 bytes. The largest part is sk_buff_head with 96
bytes and here the spinlock with 72 bytes.
The size value still fits in this u8 leaving some room for more.

On -RT struct ipoib_neigh put on weight and has 392 bytes. The main
reason is sk_buff_head with 288 and the fatty here is spinlock with 192
bytes. This does no longer fit into into neigh_priv_len and gcc
complains.

This patch changes neigh_priv_len from being 8bit to 16bit. Since the
following element (dev_id) is 16bit followed by a spinlock which is
aligned, the struct remains with a total size of 3200 (allmodconfig) /
2048 (with as much debug off as possible) bytes on x86-64.
On x86-32 the struct is 1856 (allmodconfig) / 1216 (with as much debug
off as possible) bytes long. The numbers were gained with and without
the patch to prove that this change does not increase the size of the
struct.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h