linux-stable/drivers/firmware/efi
Ard Biesheuvel 80424b02d4 efi: Reduce the amount of memblock reservations for persistent allocations
The current implementation of efi_mem_reserve_persistent() is rather
naive, in the sense that for each invocation, it creates a separate
linked list entry to describe the reservation. Since the linked list
entries themselves need to persist across subsequent kexec reboots,
every reservation created this way results in two memblock_reserve()
calls at the next boot.

On arm64 systems with 100s of CPUs, this may result in a excessive
number of memblock reservations, and needless fragmentation.

So instead, make use of the newly updated struct linux_efi_memreserve
layout to put multiple reservations into a single linked list entry.
This should get rid of the numerous tiny memblock reservations, and
effectively cut the total number of reservations in half on arm64
systems with many CPUs.

 [ mingo: build warning fix. ]

Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-11-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2018-11-30 09:37:57 +01:00
..
libstub efi: Permit multiple entries in persistent memreserve data structure 2018-11-30 09:10:31 +01:00
test efi/efi_test: add exporting ResetSystem runtime service 2018-09-26 12:04:00 +02:00
apple-properties.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
arm-init.c efi/arm: Revert deferred unmap of early memmap mapping 2018-11-15 10:04:46 +01:00
arm-runtime.c efi/arm: Revert deferred unmap of early memmap mapping 2018-11-15 10:04:46 +01:00
capsule-loader.c efi/capsule-loader: Don't output reset log when reset flags are not set 2018-05-14 08:57:49 +02:00
capsule.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
cper-arm.c efi/cper: Remove the INDENT_SP silliness 2018-05-14 08:57:47 +02:00
cper-x86.c efi: Decode IA32/X64 Context Info structure 2018-05-14 08:57:48 +02:00
cper.c efi/cper: Use consistent types for UUIDs 2018-07-22 14:13:43 +02:00
dev-path-parser.c
efi-bgrt.c efi/bgrt: Drop __initdata from bgrt_image_size 2018-07-03 17:43:10 +02:00
efi-pstore.c pstore: Convert internal records to timespec64 2018-06-05 16:57:31 -07:00
efi.c efi: Reduce the amount of memblock reservations for persistent allocations 2018-11-30 09:37:57 +01:00
efibc.c
efivars.c compat: Cleanup in_compat_syscall() callers 2018-11-01 13:02:21 +01:00
esrt.c efi/esrt: Only call efi_mem_reserve() for boot services memory 2018-07-17 09:15:05 +02:00
fake_mem.c
Kconfig efi/libstub/arm: default EFI_ARMSTUB_DTB_LOADER to y 2018-09-12 16:41:41 +02:00
Makefile efi: Decode IA32/X64 Processor Error Section 2018-05-14 08:57:47 +02:00
memattr.c
memmap.c efi/arm: Revert deferred unmap of early memmap mapping 2018-11-15 10:04:46 +01:00
reboot.c
runtime-map.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
runtime-wrappers.c efi: Fix debugobjects warning on 'efi_rts_work' 2018-11-15 10:04:45 +01:00
tpm.c efi: call get_event_log before ExitBootServices 2018-01-08 12:58:35 +02:00
vars.c firmware/efi: Add NULL pointer checks in efivars API functions 2018-11-30 09:06:32 +01:00