android_kernel_samsung_a7y1.../arch
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
..
alpha
arc ARC: define __ALIGN_STR and __ALIGN symbols for ARC 2020-04-07 14:11:40 +02:00
arm ARM: dts: dra7: Add "dma-ranges" property to PCIe RC DT nodes 2020-04-07 14:13:52 +02:00
arm64 arm64: kbuild: remove compressed images on 'make ARCH=arm64 (dist)clean' 2020-04-07 13:48:08 +02:00
avr32
blackfin
c6x
cris
frv
h8300
hexagon hexagon: work around compiler crash 2020-04-07 13:37:21 +02:00
ia64
m32r
m68k m68k: Call timer_interrupt() with interrupts disabled 2020-04-07 13:44:29 +02:00
metag
microblaze microblaze: Prevent the overflow of the start 2020-04-07 13:57:29 +02:00
mips MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()' 2020-04-07 14:04:51 +02:00
mn10300
nios2 nios2: ksyms: Add missing symbol exports 2020-04-07 13:40:50 +02:00
openrisc
parisc parisc: Fix compiler warnings in debug_core.c 2020-04-07 13:29:00 +02:00
powerpc powerpc: Include .BTF section 2020-04-07 14:13:50 +02:00
s390 mm: prevent get_user_pages() from overflowing page refcount 2020-04-07 14:08:50 +02:00
score
sh pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs 2020-04-07 13:56:29 +02:00
sparc sparc32: fix struct ipc64_perm type definition 2020-04-07 13:49:17 +02:00
tile
um
unicore32
x86 x86/mm: split vmalloc_sync_all() 2020-04-07 14:14:34 +02:00
xtensa
Kconfig