android_kernel_xiaomi_sm7250/arch/um/kernel
Joel Fernandes (Google) eadc926dc6 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>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Change-Id: I796893ced9ac85f2dad3a4acc6f53f83abeb9d66
2022-11-12 11:21:18 +00:00
..
skas um: switch to RAW_COPY_USER 2017-03-28 18:24:03 -04:00
asm-offsets.c um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
config.c.in um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
dyn.lds.S um: Mark all kernel symbols as local 2021-05-22 10:59:49 +02:00
early_printk.c early_printk: consolidate random copies of identical code 2013-04-29 18:28:13 -07:00
exec.c sched/headers: Prepare to remove the <linux/mm_types.h> dependency from <linux/sched.h> 2017-03-02 08:42:37 +01:00
exitcode.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
gmon_syms.c um: Fix CONFIG_GCOV for modules. 2017-09-13 22:33:54 +02:00
gprof_syms.c um: get rid of pointless include "..." where include <...> will do 2012-10-09 22:28:45 +02:00
initrd.c um: Fix to call read_initrd after init_bootmem 2017-05-03 22:38:16 +02:00
irq.c um: Fix IRQ controller regression on console read 2020-01-27 14:50:59 +01:00
kmsg_dump.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ksyms.c um: Move syscall() declaration into os.h 2015-05-31 13:14:07 +02:00
maccess.c um: Implement probe_kernel_read() 2013-09-07 10:38:34 +02:00
Makefile um: Support kcov 2016-08-04 00:18:06 +02:00
mem.c mm: treewide: remove unused address argument from pte_alloc functions 2022-11-12 11:21:18 +00:00
physmem.c um: Use os_warn to print out pre-boot warning/error messages 2017-07-05 23:18:25 +02:00
process.c um: Fix FP register size for XSTATE/XSAVE 2017-09-13 22:24:38 +02:00
ptrace.c signal/um: Use force_sig_fault where appropriate 2018-04-25 10:44:11 -05:00
reboot.c sched/headers: Prepare to remove the <linux/mm_types.h> dependency from <linux/sched.h> 2017-03-02 08:42:37 +01:00
sigio.c um: change sigio_spinlock to a mutex 2020-11-05 11:08:39 +01:00
signal.c Revert "um: Fix get_signal() usage" 2016-03-05 22:16:40 +01:00
stacktrace.c um: Add support for CONFIG_STACKTRACE 2014-10-13 21:46:25 +02:00
syscall.c mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff() 2018-04-02 20:16:11 +02:00
sysrq.c um: Fix _print_addr() 2017-05-03 22:30:20 +02:00
time.c uml: fix a boot splat wrt use of cpu_all_mask 2019-06-15 11:54:05 +02:00
tlb.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
trap.c mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
um_arch.c UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:19:22 +02:00
umid.c um: Use os_warn to print out pre-boot warning/error messages 2017-07-05 23:18:25 +02:00
uml.lds.S um: Mark all kernel symbols as local 2021-05-22 10:59:49 +02:00
vmlinux.lds.S