linux-stable/drivers/acpi
Joerg Roedel 6c1051ffc7 x86/mm: split vmalloc_sync_all()
commit 763802b53a upstream.

Commit 3f8fd02b1b ("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: 3f8fd02b1b ("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-03-25 08:06:13 +01:00
..
acpica ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1 2020-02-24 08:34:43 +01:00
apei x86/mm: split vmalloc_sync_all() 2020-03-25 08:06:13 +01:00
arm64 ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id() 2019-08-16 10:12:48 +02:00
dptf
nfit acpi/nfit: Always dump _DSM output payload 2019-05-16 19:41:19 +02:00
pmic ACPI / PMIC: xpower: Fix TS-pin current-source handling 2019-01-16 22:04:34 +01:00
x86 x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
ac.c ACPI updates for 4.18-rc1 2018-06-05 10:08:27 -07:00
acpi_amba.c
acpi_apd.c ACPI: APD: Add AMD misc clock handler support 2018-05-17 12:44:06 +02:00
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c ACPI / PM: LPIT: Register sysfs attributes based on FADT 2018-11-13 11:08:24 -08:00
acpi_lpss.c ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS 2020-01-27 14:51:00 +01:00
acpi_memhotplug.c mm/memory_hotplug: make remove_memory() take the device_hotplug_lock 2020-01-29 16:43:24 +01:00
acpi_pad.c
acpi_platform.c ACPI / platform: Add SMB0001 HID to forbidden_id_list 2018-11-27 16:13:10 +01:00
acpi_pnp.c
acpi_processor.c ACPI / processor: don't print errors for processorIDs == 0xff 2019-10-05 13:09:38 +02:00
acpi_tad.c
acpi_video.c ACPI: video: Add new hw_changes_brightness quirk, set it on PB Easynote MZ35 2019-10-01 08:26:11 +02:00
acpi_watchdog.c ACPI: watchdog: Allow disabling WDAT at boot 2020-03-20 11:55:52 +01:00
battery.c ACPI / battery: Deal better with neither design nor full capacity not being reported 2020-02-11 04:33:59 -08:00
bgrt.c
blacklist.c ACPI: blacklist: fix clang warning for unused DMI table 2019-08-06 19:06:50 +02:00
bus.c ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data() 2019-12-17 20:35:05 +01:00
button.c ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch 2020-02-24 08:34:45 +01:00
cm_sbs.c
container.c
cppc_acpi.c ACPI: CPPC: Set pcc_data[pcc_ss_id] to NULL in acpi_cppc_processor_exit() 2019-10-29 09:19:52 +01:00
custom_method.c ACPI: custom_method: fix memory leaks 2019-10-05 13:09:53 +02:00
debugfs.c
device_pm.c ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS 2020-01-27 14:51:00 +01:00
device_sysfs.c ACPI / device_sysfs: Avoid OF modalias creation for removed device 2019-03-23 20:09:57 +01:00
dock.c
ec.c Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk" 2019-04-20 09:16:04 +02:00
ec_sys.c
event.c
evged.c
fan.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
glue.c
hed.c
internal.h ACPI: EC / PM: Disable non-wakeup GPEs for suspend-to-idle 2019-04-20 09:16:03 +02:00
ioapic.c
irq.c
Kconfig ACPI: fix menuconfig presentation of ACPI submenu 2018-08-23 10:20:07 +02:00
Makefile ACPI: Enable PPTT support on ARM64 2018-05-17 17:28:09 +01:00
numa.c ACPI: NUMA: Use correct type for printing addresses on i386-PAE 2019-02-20 10:25:39 +01:00
nvs.c
osi.c ACPI / OSI: Add OEM _OSI string to enable NVidia HDMI audio 2018-07-20 10:12:41 +02:00
osl.c ACPI: OSL: only free map once in osl.c 2019-12-17 20:35:05 +01:00
pci_irq.c ACPI / PCI: fix acpi_pci_irq_enable() memory leak 2019-10-05 13:09:53 +02:00
pci_link.c
pci_mcfg.c
pci_root.c PCI/ACPI: Correct error message for ASPM disabling 2019-11-20 18:46:52 +01:00
pci_slot.c
power.c ACPI: power: Skip duplicate power resource references in _PRx 2019-01-16 22:04:33 +01:00
pptt.c ACPI/PPTT: Add support for ACPI 6.3 thread flag 2019-10-17 13:45:34 -07:00
proc.c
processor_core.c xen/ACPI: don't upload Px/Cx data for disabled processors 2018-08-20 14:46:18 -04:00
processor_driver.c
processor_idle.c
processor_pdc.c
processor_perflib.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
processor_thermal.c
processor_throttling.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
property.c ACPI / property: fix handling of data_nodes in acpi_get_next_subnode() 2019-05-31 06:46:11 -07:00
reboot.c ACPI: add missing newline to printk 2018-05-02 13:01:08 +02:00
resource.c
sbs.c ACPI / SBS: Fix GPE storm on recent MacBookPro's 2019-04-20 09:16:01 +02:00
sbshc.c ACPI / SBS: Fix rare oops when removing modules 2019-11-24 08:20:31 +01:00
sbshc.h
scan.c ACPI / scan: Create platform device for INT33FE ACPI nodes 2019-12-01 09:16:35 +01:00
sleep.c ACPI: PM: Set enable_for_wake for wakeup GPEs during suspend-to-idle 2019-05-22 07:37:41 +02:00
sleep.h
spcr.c ACPI: SPCR: Consider baud rate 0 as preconfigured state 2019-02-12 19:47:02 +01:00
sysfs.c ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100 2020-01-09 10:19:04 +01:00
tables.c arm64 updates for 4.18: 2018-06-08 11:10:58 -07:00
thermal.c
utils.c ACPI / utils: Drop reference in test for device presence 2019-04-20 09:15:58 +02:00
video_detect.c ACPI: video: Do not export a non working backlight interface on MSI MS-7721 boards 2020-02-11 04:33:59 -08:00
wakeup.c