linux/arch
Rasmus Villemoes a051216427 powerpc/fadump: rename cpu_online_mask member of struct fadump_crash_info_header
The four cpumasks cpu_{possible,online,present,active}_bits are exposed
readonly via the corresponding const variables cpu_xyz_mask.  But they are
also accessible for arbitrary writing via the exposed functions
set_cpu_xyz.  There's quite a bit of code throughout the kernel which
iterates over or otherwise accesses these bitmaps, and having the access
go via the cpu_xyz_mask variables is nowadays [1] simply a useless
indirection.

It may be that any problem in CS can be solved by an extra level of
indirection, but that doesn't mean every extra indirection solves a
problem.  In this case, it even necessitates some minor ugliness (see
4/6).

Patch 1/6 is new in v2, and fixes a build failure on ppc by renaming a
struct member, to avoid problems when the identifier cpu_online_mask
becomes a macro later in the series.  The next four patches eliminate the
cpu_xyz_mask variables by simply exposing the actual bitmaps, after
renaming them to discourage direct access - that still happens through
cpu_xyz_mask, which are now simply macros with the same type and value as
they used to have.

After that, there's no longer any reason to have the setter functions be
out-of-line: The boolean parameter is almost always a literal true or
false, so by making them static inlines they will usually compile to one
or two instructions.

For a defconfig build on x86_64, bloat-o-meter says we save ~3000 bytes.
We also save a little stack (stackdelta says 127 functions have a 16 byte
smaller stack frame, while two grow by that amount).  Mostly because, when
iterating over the mask, gcc typically loads the value of cpu_xyz_mask
into a callee-saved register and from there into %rdi before each
find_next_bit call - now it can just load the appropriate immediate
address into %rdi before each call.

[1] See Rusty's kind explanation
http://thread.gmane.org/gmane.linux.kernel/2047078/focus=2047722 for
some historic context.

This patch (of 6):

As preparation for eliminating the indirect access to the various global
cpu_*_bits bitmaps via the pointer variables cpu_*_mask, rename the
cpu_online_mask member of struct fadump_crash_info_header to simply
online_mask, thus allowing cpu_online_mask to become a macro.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-01-20 17:09:18 -08:00
..
alpha mm: arch: remove duplicate definitions of MADV_FREE 2016-01-20 17:09:18 -08:00
arc Kconfig: remove HAVE_LATENCYTOP_SUPPORT 2016-01-16 11:17:23 -08:00
arm virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
arm64 virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
avr32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2016-01-18 12:50:55 -08:00
blackfin virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
c6x Merge branch 'for-linux-next' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming 2016-01-12 13:00:16 -08:00
cris cris: nand: remove useless mtd->priv = chip assignments 2015-12-18 13:22:11 -08:00
frv arch/frv/include/asm/io.h: accept const void pointers for read{b,w,l}() 2016-01-20 17:09:18 -08:00
h8300 h8300: Rename ctlr_out/in[bwl] to raw_read/write[bwl] 2015-12-15 10:12:03 +01:00
hexagon
ia64 virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
m32r m32r: fix m32104ut_defconfig build fail 2016-01-14 16:00:49 -08:00
m68k Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-01-12 17:11:47 -08:00
metag virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
microblaze Kconfig: remove HAVE_LATENCYTOP_SUPPORT 2016-01-16 11:17:23 -08:00
mips mm: arch: remove duplicate definitions of MADV_FREE 2016-01-20 17:09:18 -08:00
mn10300 libnvdimm, pfn, pmem: allocate memmap array in persistent memory 2016-01-15 17:56:32 -08:00
nios2 nios2: fix cache coherency 2015-11-26 22:25:58 +08:00
openrisc
parisc mm: arch: remove duplicate definitions of MADV_FREE 2016-01-20 17:09:18 -08:00
powerpc powerpc/fadump: rename cpu_online_mask member of struct fadump_crash_info_header 2016-01-20 17:09:18 -08:00
s390 virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
score
sh virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
sparc virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
tile virtio: barrier rework+fixes 2016-01-18 16:44:24 -08:00
um um: kill pfn_t 2016-01-15 17:56:32 -08:00
unicore32 Kconfig: remove HAVE_LATENCYTOP_SUPPORT 2016-01-16 11:17:23 -08:00
x86 platform-drivers-x86 for 4.5-1 2016-01-19 17:54:15 -08:00
xtensa mm: arch: remove duplicate definitions of MADV_FREE 2016-01-20 17:09:18 -08:00
.gitignore
Kconfig mm: mmap: add new /proc tunable for mmap_base ASLR 2016-01-14 16:00:49 -08:00