linux/arch/arm
Joel Fernandes (Google) 4cf5892495 mm: treewide: remove unused address argument from pte_alloc functions
Patch series "Add support for fast mremap".

This series speeds up the mremap(2) syscall by copying page tables at
the PMD level even for non-THP systems.  There is concern that the extra
'address' argument that mremap passes to pte_alloc may do something
subtle architecture related in the future that may make the scheme not
work.  Also we find that there is no point in passing the 'address' to
pte_alloc since its unused.  This patch therefore removes this argument
tree-wide resulting in a nice negative diff as well.  Also ensuring
along the way that the enabled architectures do not do anything funky
with the 'address' argument that goes unnoticed by the optimization.

Build and boot tested on x86-64.  Build tested on arm64.  The config
enablement patch for arm64 will be posted in the future after more
testing.

The changes were obtained by applying the following Coccinelle script.
(thanks Julia for answering all Coccinelle questions!).
Following fix ups were done manually:
* Removal of address argument from  pte_fragment_alloc
* Removal of pte_alloc_one_fast definitions from m68k and microblaze.

// Options: --include-headers --no-includes
// Note: I split the 'identifier fn' line, so if you are manually
// running it, please unsplit it so it runs for you.

virtual patch

@pte_alloc_func_def depends on patch exists@
identifier E2;
identifier fn =~
"^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$";
type T2;
@@

 fn(...
- , T2 E2
 )
 { ... }

@pte_alloc_func_proto_noarg depends on patch exists@
type T1, T2, T3, T4;
identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$";
@@

(
- T3 fn(T1, T2);
+ T3 fn(T1);
|
- T3 fn(T1, T2, T4);
+ T3 fn(T1, T2);
)

@pte_alloc_func_proto depends on patch exists@
identifier E1, E2, E4;
type T1, T2, T3, T4;
identifier fn =~
"^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$";
@@

(
- T3 fn(T1 E1, T2 E2);
+ T3 fn(T1 E1);
|
- T3 fn(T1 E1, T2 E2, T4 E4);
+ T3 fn(T1 E1, T2 E2);
)

@pte_alloc_func_call depends on patch exists@
expression E2;
identifier fn =~
"^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$";
@@

 fn(...
-,  E2
 )

@pte_alloc_macro depends on patch exists@
identifier fn =~
"^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$";
identifier a, b, c;
expression e;
position p;
@@

(
- #define fn(a, b, c) e
+ #define fn(a, b) e
|
- #define fn(a, b) e
+ #define fn(a) e
)

Link: http://lkml.kernel.org/r/20181108181201.88826-2-joelaf@google.com
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Suggested-by: Kirill A. Shutemov <kirill@shutemov.name>
Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: William Kucharski <william.kucharski@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-01-04 13:13:47 -08:00
..
boot ARM: Device-tree updates 2018-12-31 17:36:02 -08:00
common arm: remove the mapping_error dma_map_ops method 2018-12-06 06:56:37 -08:00
configs ARM: SoC defconfig updates 2018-12-31 17:40:14 -08:00
crypto Kbuild updates for v4.21 2018-12-29 12:03:17 -08:00
firmware ARM: 32-bit SoC platform updates 2018-08-23 13:44:43 -07:00
include mm: treewide: remove unused address argument from pte_alloc functions 2019-01-04 13:13:47 -08:00
kernel kgdb patches for 4.20-rc1 2019-01-01 15:38:14 -08:00
kvm Kconfig updates for v4.21 2018-12-29 13:03:29 -08:00
lib Merge branches 'fixes', 'misc' and 'spectre' into for-next 2018-10-10 13:53:33 +01:00
mach-actions
mach-alpine PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 treewide: add intermediate .s files to targets 2018-12-23 10:12:08 +09:00
mach-axxia
mach-bcm ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-berlin
mach-clps711x
mach-cns3xxx
mach-davinci ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx mmc: spi: Convert to use GPIO descriptors 2018-12-17 08:26:24 +01:00
mach-exynos ARM: exynos: Remove secondary startup initialization from smp_prepare_cpus 2018-11-18 15:12:50 +01:00
mach-footbridge PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-gemini
mach-highbank
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 2018-12-31 17:27:54 -08: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 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-keystone
mach-ks8695 ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson ARM: meson: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER 2018-12-10 12:43:40 -08:00
mach-mmp ARM: Device-tree updates 2018-12-31 17:36:02 -08:00
mach-moxart
mach-mv78xx0 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-mvebu PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-mxs
mach-netx
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-omap2 ARM: SoC driver updates 2018-12-31 17:32:35 -08:00
mach-orion5x PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa ARM: SoC platform updates 2018-12-31 17:27:54 -08: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 mmc: s3cmci: Use the slot GPIO descriptor 2018-12-17 08:26:24 +01:00
mach-s3c64xx regulator: wm8994: Pass descriptor instead of GPIO number 2018-11-15 11:42:08 -08:00
mach-s5pv210 ARM: s5pv210: Remove legacy setting of external wakeup interrupts 2018-11-12 21:19:48 +01:00
mach-sa1100 PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
mach-shmobile ARM: shmobile: R-Mobile: Move pm-rmobile to drivers/soc/renesas/ 2018-11-30 11:29:11 +01:00
mach-socfpga ARM: SoC platform updates 2018-12-31 17:27:54 -08:00
mach-spear
mach-sti
mach-stm32
mach-sunxi ARM: sunxi: add Allwinner ARMv5 SoCs 2018-12-03 09:57:59 +01:00
mach-tango
mach-tegra ARM: tegra: avoid section mismatch warning 2018-12-12 13:57:55 -08: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
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 Merge tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux 2018-12-28 20:08:34 -08: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 ARM: orion: avoid VLA in orion_mpp_conf 2018-11-02 22:31:24 -07:00
plat-pxa
plat-samsung ARM: samsung: Limit SAMSUNG_PM_DEBUG config option to non-Exynos platforms 2018-11-18 15:11:27 +01:00
plat-versatile
probes ARM: 8806/1: kprobes: Fix false positive with FORTIFY_SOURCE 2018-11-08 10:59:10 +00:00
tools ARM: 8787/1: wire up io_pgetevents syscall 2018-09-19 10:44:11 +01:00
vdso
vfp Merge branch 'spectre' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-11-14 13:40:22 -06:00
xen mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
Kconfig Kconfig file consolidation for v4.21 2018-12-29 13:40:29 -08:00
Kconfig-nommu
Kconfig.debug i.MX SoC changes for 4.21: 2018-12-12 13:52:48 -08:00
Makefile ARM: smp: add support for per-task stack canaries 2018-12-12 13:20:07 -08:00