kernel_optimize_test/arch/ia64/kernel
Mike Rapoport 7e1c4e2792 memblock: stop using implicit alignment to SMP_CACHE_BYTES
When a memblock allocation APIs are called with align = 0, the alignment
is implicitly set to SMP_CACHE_BYTES.

Implicit alignment is done deep in the memblock allocator and it can
come as a surprise.  Not that such an alignment would be wrong even
when used incorrectly but it is better to be explicit for the sake of
clarity and the prinicple of the least surprise.

Replace all such uses of memblock APIs with the 'align' parameter
explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
in the memblock internal allocation functions.

For the case when memblock APIs are used via helper functions, e.g.  like
iommu_arena_new_node() in Alpha, the helper functions were detected with
Coccinelle's help and then manually examined and updated where
appropriate.

The direct memblock APIs users were updated using the semantic patch below:

@@
expression size, min_addr, max_addr, nid;
@@
(
|
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)

[mhocko@suse.com: changelog update]
[akpm@linux-foundation.org: coding-style fixes]
[rppt@linux.ibm.com: fix missed uses of implicit alignment]
  Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Suggested-by: Michal Hocko <mhocko@suse.com>
Acked-by: Paul Burton <paul.burton@mips.com>	[MIPS]
Acked-by: Michael Ellerman <mpe@ellerman.id.au>	[powerpc]
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-31 08:54:16 -07:00
..
.gitignore
acpi-ext.c
acpi.c
asm-offsets.c pid: Implement PIDTYPE_TGID 2018-07-21 10:43:12 -05:00
audit.c
brl_emu.c signal/ia64: Use force_sig_fault where appropriate 2018-09-27 21:58:18 +02:00
crash_dump.c
crash.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
cyclone.c
dma-mapping.c
efi_stub.S
efi.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
elfcore.c
entry.h
entry.S
err_inject.c
esi_stub.S
esi.c
fsys.S pid: Implement PIDTYPE_TGID 2018-07-21 10:43:12 -05:00
fsyscall_gtod_data.h
ftrace.c
gate-data.S
gate.lds.S
gate.S
head.S
ia64_ksyms.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
iosapic.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
irq_ia64.c
irq_lsapic.c
irq.c
ivt.S
kprobes.c bpf/error-inject/kprobes: Clear current_kprobe and enable preempt in kprobe 2018-06-21 12:33:19 +02:00
machine_kexec.c
machvec.c ia64: remove machvec_dma_sync_{single,sg} 2018-09-17 10:15:51 -07:00
Makefile ia64/kprobes: Remove jprobe implementation 2018-06-21 12:33:09 +02:00
Makefile.gate
mca_asm.S
mca_drv_asm.S
mca_drv.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
mca_drv.h
mca.c memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
minstate.h
module.c
msi_ia64.c
nr-irqs.c
numa.c
pal.S
palinfo.c
patch.c
pci-dma.c intel-iommu: mark intel_dma_ops static 2018-09-17 10:15:58 -07:00
perfmon_default_smpl.c
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon_montecito.h
perfmon.c mm: make vm_area_alloc() initialize core fields 2018-07-21 15:24:03 -07:00
process.c
ptrace.c
relocate_kernel.S
sal.c
salinfo.c
setup.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
sigframe.h
signal.c kernel/signal.c: fix a comment error 2018-10-31 08:54:14 -07:00
smp.c
smpboot.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
stacktrace.c
sys_ia64.c
time.c
topology.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
traps.c signal/ia64: Use force_sig_fault where appropriate 2018-09-27 21:58:18 +02:00
unaligned.c signal/ia64: Use force_sig_fault where appropriate 2018-09-27 21:58:18 +02:00
uncached.c
unwind_decoder.c
unwind_i.h
unwind.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
vmlinux.lds.S