[PATCH] RCU : move three variables to __read_mostly to save space

Previous thread: [PATCH 2/6] pcmcia/3c574_cs: Fix 'shadow variable' warning by Richard Knutsson on Tuesday, December 11, 2007 - 12:32 am. (9 messages)

Next thread: Lnux 2.6.24-rc5 by Linus Torvalds on Tuesday, December 11, 2007 - 1:40 am. (3 messages)
To: Andrew Morton <akpm@...>
Cc: Dipankar Sarma <dipankar@...>, Linux kernel <linux-kernel@...>
Date: Tuesday, December 11, 2007 - 12:50 am

I noticed this vmlinux layout on i686 (where CONFIG_X86_L1_CACHE_SHIFT = 7) :

c06cdab4 d pid_caches_lh
c06cdb00 d qlowmark
c06cdb04 d qhimark
c06cdb08 d blimit
c06cdb80 d rcu_ctrlblk
c06cdc80 d rcu_bh_ctrlblk

This means that qlowmark, qhimark and blimit use a whole 128 bytes cache line.
Linker is not smart enough for us.

Moving these three variables to read_mostly section saves 116 (128-12) bytes.

# size vmlinux vmlinux.before_patch
text data bss dec hex filename
6343966 490818 630784 7465568 71ea60 vmlinux
6343966 490930 630784 7465680 71ead0 vmlinux.before_patch

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

Previous thread: [PATCH 2/6] pcmcia/3c574_cs: Fix 'shadow variable' warning by Richard Knutsson on Tuesday, December 11, 2007 - 12:32 am. (9 messages)

Next thread: Lnux 2.6.24-rc5 by Linus Torvalds on Tuesday, December 11, 2007 - 1:40 am. (3 messages)