android_kernel_samsung_a7y1.../arch/x86/mm
Joerg Roedel 18a23eb805 x86/mm: split vmalloc_sync_all()
commit 763802b53a427ed3cbd419dbba255c414fdd9e7c upstream.

Commit 3f8fd02b1bf1 ("mm/vmalloc: Sync unmappings in
__purge_vmap_area_lazy()") introduced a call to vmalloc_sync_all() in
the vunmap() code-path.  While this change was necessary to maintain
correctness on x86-32-pae kernels, it also adds additional cycles for
architectures that don't need it.

Specifically on x86-64 with CONFIG_VMAP_STACK=y some people reported
severe performance regressions in micro-benchmarks because it now also
calls the x86-64 implementation of vmalloc_sync_all() on vunmap().  But
the vmalloc_sync_all() implementation on x86-64 is only needed for newly
created mappings.

To avoid the unnecessary work on x86-64 and to gain the performance
back, split up vmalloc_sync_all() into two functions:

	* vmalloc_sync_mappings(), and
	* vmalloc_sync_unmappings()

Most call-sites to vmalloc_sync_all() only care about new mappings being
synchronized.  The only exception is the new call-site added in the
above mentioned commit.

Shile Zhang directed us to a report of an 80% regression in reaim
throughput.

Fixes: 3f8fd02b1bf1 ("mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy()")
Reported-by: kernel test robot <oliver.sang@intel.com>
Reported-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Borislav Petkov <bp@suse.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>	[GHES]
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20191009124418.8286-1-joro@8bytes.org
Link: https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/4D3JPPHBNOSPFK2KEPC6KGKS6J25AIDB/
Link: http://lkml.kernel.org/r/20191113095530.228959-1-shile.zhang@linux.alibaba.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:14:34 +02:00
..
kmemcheck A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
amdtopology.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dump_pagetables.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extable.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
fault.c x86/mm: split vmalloc_sync_all() 2020-04-07 14:14:34 +02:00
gup.c mm: prevent get_user_pages() from overflowing page refcount 2020-04-07 14:08:50 +02:00
highmem_32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hugetlbpage.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
init_32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
init_64.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
init.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
iomap_32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioremap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kaiser.c x86/speculation: Support 'mitigations=' cmdline option 2020-04-06 17:01:04 +02:00
kasan_init_64.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kmmio.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mm_internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mmap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mmio-mod.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mpx.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
numa_32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
numa_64.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
numa_emulation.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
numa_internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
numa.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pageattr-test.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pageattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pat_internal.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pat_rbtree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pf_in.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pf_in.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pgtable_32.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pgtable.c x86/mm: Use the correct function type for native_set_fixmap() 2020-04-07 13:20:40 +02:00
physaddr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
physaddr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
setup_nx.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
srat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
testmmiotrace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tlb.c x86/speculation: Prepare for conditional IBPB in switch_mm() 2020-04-06 16:55:03 +02:00