Subject: Re: [PATCH net-2.6.26 1/2] Shrink size of net_device by filling alignment holes in it.

From: Pavel Emelyanov <[email-masked]>
Date: Tue, 08 Apr 2008 12:41:18 +0400

Ok, here are the results (summary):

i386, no patch, L1_CACHE_SHIFT=6:
        /* size: 1024, cachelines: 16 */
        /* sum members: 897, holes: 5, sum holes: 115 */
        /* padding: 12 */

i386, no patch, L1_CACHE_SHIFT=7:
        /* size: 1280, cachelines: 20 */
        /* sum members: 897, holes: 5, sum holes: 307 */
        /* padding: 76 */

i386, with patch, L1_CACHE_SHIFT=6:
        /* size: 960, cachelines: 15 */
        /* sum members: 897, holes: 4, sum holes: 47 */
        /* padding: 16 */

i386, with patch, L1_CACHE_SHIFT=7:
        /* size: 1024, cachelines: 16 */
        /* sum members: 897, holes: 4, sum holes: 111 */
        /* padding: 16 */

x86_64, no patch, L1_CACHE_SHIFT=7:
        /* size: 1792, cachelines: 28 */
        /* sum members: 1589, holes: 13, sum holes: 155 */
        /* padding: 48 */
        /* paddings: 1, sum paddings: 4 */

x86_64, with patch, L1_CACHE_SHIFT=7:
        /* size: 1920, cachelines: 30 */
        /* sum members: 1589, holes: 13, sum holes: 275 */
        /* padding: 56 */
        /* paddings: 1, sum paddings: 4 */

The +128 bytes on x86_64 is due to enlarged hole before
the refcnt field :(

So, on the i386 the structure shrinks, but on x86_64 - grows, but
on i386 it can be allocated from a twice smaller cache, while on
x86_64 nothing changes - it still fits the size-2048.

BTW, L1_CACHE_SHIFT=7 is set by default for distributions such as
rhel5, suse10 and fedora8...

So, does it worth trying to push them to Dave? :)

Thanks,
Pavel