linux-stable/arch/powerpc/mm
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
..
8xx_mmu.c powerpc/8xx: use modify_instruction_site() 2018-12-19 18:56:32 +11:00
40x_mmu.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
44x_mmu.c powerpc/44x: use patch_sites for TLB handlers patching 2018-12-19 18:56:32 +11:00
copro_fault.c mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
dma-noncoherent.c powerpc/dma: split the two __dma_alloc_coherent implementations 2018-12-20 22:21:20 +11:00
drmem.c powerpc/mm/drmem: Fix unexpected flag value in ibm,dynamic-memory-v2 2018-02-23 16:45:51 +11:00
dump_bats.c powerpc/mm: dump block address translation on book3s/32 2018-12-04 19:46:49 +11:00
dump_hashpagetable.c powerpc: remove superflous inclusions of asm/fixmap.h 2018-07-30 22:48:18 +10:00
dump_linuxpagetables-8xx.c powerpc/8xx: change name of a few page flags to avoid confusion 2018-10-14 18:04:09 +11:00
dump_linuxpagetables-book3s64.c powerpc/book3s64: fix dump_linuxpagetables "present" flag 2018-10-20 13:26:47 +11:00
dump_linuxpagetables-generic.c powerpc/mm: add exec protection on powerpc 603 2018-12-19 18:56:32 +11:00
dump_linuxpagetables.c powerpc/mm: Fix linux page tables build with some configs 2018-11-27 11:03:36 +11:00
dump_linuxpagetables.h powerpc/mm: Split dump_pagelinuxtables flag_array table 2018-10-14 18:04:09 +11:00
dump_sr.c powerpc/mm: dump segment registers on book3s/32 2018-12-04 19:45:54 +11:00
fault.c powerpc updates for 4.21 2018-12-27 10:43:24 -08:00
fsl_booke_mmu.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
hash64_4k.c powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group 2018-07-24 22:03:17 +10:00
hash64_64k.c powerpc/mm/hash: Remove the superfluous bitwise operation when find hpte group 2018-07-24 22:03:17 +10:00
hash_low_32.S powerpc/book3s/32: Use patch_site to patch hash functions 2018-12-19 18:56:32 +11:00
hash_native_64.c powerpc/64s/hash: Do not use PPC_INVALIDATE_ERAT on CPUs before POWER9 2018-10-04 23:16:53 +10:00
hash_utils_64.c powerpc/64s/hash: Simplify slb_flush_and_rebolt() 2018-10-14 18:04:09 +11:00
highmem.c powerpc/mm: remove warning about ‘type’ being set 2018-08-10 22:12:38 +10:00
hugepage-hash64.c arch/powerpc/mm/hash: validate the pte entries before handling the hash fault 2018-10-03 15:39:59 +10:00
hugetlbpage-book3e.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hugetlbpage-hash64.c arch/powerpc/mm/hash: validate the pte entries before handling the hash fault 2018-10-03 15:39:59 +10:00
hugetlbpage-radix.c powerpc updates for 4.15 2017-11-16 12:47:46 -08:00
hugetlbpage.c powerpc updates for 4.21 2018-12-27 10:43:24 -08:00
init-common.c powerpc/mm: remove unnecessary test in pgtable_cache_init() 2018-12-04 19:45:01 +11:00
init_32.c powerpc/mm/32: Remove the reserved memory hack 2018-04-01 00:47:44 +11:00
init_64.c powerpc/mm: Fallback to RAM if the altmap is unusable 2018-12-09 21:33:21 +11:00
Makefile powerpc/mm: dump block address translation on book3s/32 2018-12-04 19:46:49 +11:00
mem.c mm, memory_hotplug: add nid parameter to arch_remove_memory 2018-12-28 12:11:49 -08:00
mmap.c exec: pass stack rlimit into mm layout functions 2018-04-11 10:28:37 -07:00
mmu_context.c powerpc/mm: Extend pte_fragment functionality to PPC32 2018-12-04 19:45:01 +11:00
mmu_context_book3s64.c powerpc/mm: Move pte_fragment_alloc() to a common location 2018-12-04 19:45:01 +11:00
mmu_context_hash32.c powerpc: remove unnecessary inclusion of asm/tlbflush.h 2018-07-30 22:48:20 +10:00
mmu_context_iommu.c powerpc/vfio/iommu/kvm: Do not pin device memory 2018-12-21 16:20:46 +11:00
mmu_context_nohash.c powerpc/mm: define an empty slice_init_new_context_exec() 2018-12-19 18:56:32 +11:00
mmu_decl.h powerpc: change CONFIG_6xx to CONFIG_PPC_BOOK3S_32 2018-11-26 22:33:37 +11:00
numa.c powerpc: Use device_type helpers to access the node type 2018-11-26 22:33:37 +11:00
pgtable-book3e.c powerpc: handover page flags with a pgprot_t parameter 2018-10-14 18:04:09 +11:00
pgtable-book3s64.c powerpc/mm: Avoid useless lock with single page fragments 2018-12-04 19:45:01 +11:00
pgtable-frag.c mm: treewide: remove unused address argument from pte_alloc functions 2019-01-04 13:13:47 -08:00
pgtable-hash64.c powerpc: handover page flags with a pgprot_t parameter 2018-10-14 18:04:09 +11:00
pgtable-radix.c powerpc/mm/radix: Display if mappings are exec or not 2018-10-20 13:26:47 +11:00
pgtable.c powerpc/mm: add exec protection on powerpc 603 2018-12-19 18:56:32 +11:00
pgtable_32.c mm: treewide: remove unused address argument from pte_alloc functions 2019-01-04 13:13:47 -08:00
pgtable_64.c powerpc/mm: use pte helpers in generic code 2018-10-14 18:04:09 +11:00
pkeys.c powerpc/pkeys: Fix handling of pkey state across fork() 2018-12-21 14:46:50 +11:00
ppc_mmu_32.c powerpc/book3s/32: fix number of bats in p/v_block_mapped() 2018-12-19 18:56:32 +11:00
slb.c powerpc/mm/64s: Fix preempt warning in slb_allocate_kernel() 2018-11-12 13:22:10 +11:00
slice.c powerpc/mm: fix always true/false warning in slice.c 2018-10-20 13:26:47 +11:00
subpage-prot.c powerpc: remove unnecessary inclusion of asm/tlbflush.h 2018-07-30 22:48:20 +10:00
tlb-radix.c powerpc updates for 4.20 2018-10-26 14:36:21 -07:00
tlb_hash32.c powerpc/sparse: Fix plain integer as NULL pointer warning 2018-05-25 12:04:38 +10:00
tlb_hash64.c powerpc/mm: Add support for handling > 512TB address in SLB miss 2018-03-31 00:10:38 +11:00
tlb_low_64e.S powerpc/fsl: Flush the branch predictor at each kernel entry (64bit) 2018-12-20 22:59:03 +11:00
tlb_nohash.c powerpc/8xx: Enable 512k hugepage support with HW assistance 2018-12-04 19:45:01 +11:00
tlb_nohash_low.S powerpc: clean inclusions of asm/feature-fixups.h 2018-07-30 22:48:17 +10:00
vphn.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vphn.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00