1
0
Fork 0
alistair23-linux/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 ARM: Always build secure_cntvoff.S on ARM V7 to fix shmobile !SMP build 2018-06-23 18:26:48 -07:00
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 ARM: 32-bit SoC platform updates 2018-08-23 13:44:43 -07:00
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 arch: define the ARCH_DMA_ADDR_T_64BIT config symbol in lib/Kconfig 2018-05-09 06:57:04 +02:00
mach-bcm PCI: controller: Move PCI_DOMAINS selection to arch Kconfig 2018-06-26 15:37:37 -05:00
mach-berlin ARM: berlin: switch to SPDX license identifier 2018-05-24 14:49:09 +08:00
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 ARM: exynos: Fix imprecise abort during Exynos5422 suspend to RAM 2018-08-30 19:46:06 +02:00
mach-footbridge treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
mach-gemini
mach-highbank arch: define the ARCH_DMA_ADDR_T_64BIT config symbol in lib/Kconfig 2018-05-09 06:57:04 +02:00
mach-hisi ARM: hisi: handle of_iomap and fix missing of_node_put 2018-07-16 17:36:50 +01:00
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 ARM: keystone: fix platform_domain_notifier array overrun 2018-05-14 09:24:29 -07:00
mach-ks8695 i2c: gpio: move header to platform_data 2018-05-17 16:27:09 +02:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson ARM: meson: merge Kconfig symbol MACH_MESON8B into MACH_MESON8 2018-05-23 10:08:13 -07:00
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 arm: npcm: enable L2 cache in NPCM7xx architecture 2018-04-10 16:40:03 +02:00
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 ARM: rockchip: Force CONFIG_PM on Rockchip systems 2018-08-24 08:50:23 -07:00
mach-rpc mm: do not initialize TLB stack vma's with vma_init() 2018-08-01 13:43:38 -07:00
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 PCI: controller: Move PCI_DOMAINS selection to arch Kconfig 2018-06-26 15:37:37 -05:00
mach-spear
mach-sti
mach-stm32 ARM: stm32: Don't select DMA unconditionally on STM32MP157C 2018-05-25 15:26:38 -07:00
mach-sunxi ARM: sun8i: smp: Add support for A83T 2018-05-08 15:00:20 +02:00
mach-tango
mach-tegra ARM: SoC platform updates 2018-06-11 17:49:09 -07:00
mach-u300 ARM: u300: Delete dummy SPI chip 2018-09-06 10:02:26 -07:00
mach-uniphier ARM: uniphier: select RESET_CONTROLLER 2018-07-31 19:04:41 -07:00
mach-ux500 ARM: ux500: Cut down Kconfig options 2018-05-04 11:02:52 +02:00
mach-versatile mmc: mmci: Drop support for pdata GPIO numbers 2018-10-08 11:40:43 +02:00
mach-vexpress treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
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 ARM: net: bpf: improve 64-bit ALU implementation 2018-07-13 15:26:42 +02:00
nwfpe
oprofile
plat-iop
plat-omap ARM/time: Remove read_boot_clock64() 2018-07-20 00:02:41 +02:00
plat-orion
plat-pxa ARM: pxa: change SSP DMA channels allocation 2018-06-18 21:32:41 +02:00
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 Updates for v4.19: 2018-08-20 18:32:00 -07:00
tools ARM: 8787/1: wire up io_pgetevents syscall 2018-09-19 10:44:11 +01:00
vdso arm: port KCOV to arm 2018-06-15 07:55:24 +09:00
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