kernel_optimize_test/arch/arm
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
..
boot ARM: SoC device tree updates for 4.20 2018-10-29 15:05:20 -07:00
common
configs i.MX defconfig update for 4.20: 2018-10-11 15:24:50 +02:00
crypto crypto: arm/crc32 - avoid warning when compiling with Clang 2018-09-21 13:24:52 +08:00
firmware
include treewide: remove current_text_addr 2018-10-31 08:54:12 -07:00
kernel memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
kvm ARM: KVM: Correctly order SGI register entries in the cp15 array 2018-10-09 11:55:47 +01:00
lib Merge branches 'fixes', 'misc' and 'spectre' into for-next 2018-10-10 13:53:33 +01:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
mach-axxia
mach-bcm
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci gpio: davinci: Remove unneeded GPIO macro 2018-09-20 08:36:14 -07:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx This is the bulk of GPIO changes for the v4.20 series: 2018-10-23 08:45:05 +01:00
mach-exynos
mach-footbridge
mach-gemini
mach-highbank
mach-hisi
mach-imx ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
mach-integrator mmc: mmci: Drop support for pdata GPIO numbers 2018-10-08 11:40:43 +02:00
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h 2018-10-03 11:12:25 +02:00
mach-keystone
mach-ks8695
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson
mach-mmp USB/PHY patches for 4.20-rc1 2018-10-26 08:14:13 -07:00
mach-moxart
mach-mv78xx0
mach-mvebu ARM: mvebu: use dt_fixup to provide fallback for enable-method 2018-09-24 17:15:24 +02:00
mach-mxs
mach-netx
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
mach-omap2 memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
mach-orion5x mtd: rawnand: Move platform_nand_xxx definitions out of rawnand.h 2018-10-03 11:12:25 +02:00
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa regulator: Regulator updates for next release 2018-10-23 01:54:44 +01:00
mach-qcom
mach-realview
mach-rockchip
mach-rpc
mach-s3c24xx ARM: s3c24xx: Restore proper usage of pr_info/pr_cont 2018-09-19 19:11:17 +02:00
mach-s3c64xx regulator: fixed: Convert to use GPIO descriptor only 2018-09-17 14:32:22 -07:00
mach-s5pv210
mach-sa1100 regulator: fixed: Convert to use GPIO descriptor only 2018-09-17 14:32:22 -07:00
mach-shmobile ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
mach-socfpga
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tango
mach-tegra
mach-u300 ARM: u300: Delete dummy SPI chip 2018-09-06 10:02:26 -07:00
mach-uniphier
mach-ux500
mach-versatile mmc: mmci: Drop support for pdata GPIO numbers 2018-10-08 11:40:43 +02:00
mach-vexpress
mach-vt8500
mach-w90x900
mach-zx
mach-zynq ARM: zynq: Convert to using %pOFn instead of device_node.name 2018-09-05 15:27:16 +02:00
mm mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
net
nwfpe
oprofile
plat-iop
plat-omap
plat-orion
plat-pxa
plat-samsung ARM: samsung: Limit SAMSUNG_PM_CHECK config option to non-Exynos platforms 2018-10-01 18:42:48 +02:00
plat-versatile
probes
tools ARM: 8787/1: wire up io_pgetevents syscall 2018-09-19 10:44:11 +01:00
vdso
vfp Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2018-10-24 11:22:39 +01:00
xen mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
Kconfig mm: remove CONFIG_HAVE_MEMBLOCK 2018-10-31 08:54:15 -07:00
Kconfig-nommu
Kconfig.debug ARM: SoC platform updates for 4.20 2018-10-29 15:37:33 -07:00
Makefile Devicetree updates for 4.20: 2018-10-26 12:09:58 -07:00