linux-stable/arch/x86/mm
Daniel Jordan fe124c95df x86/mm: use max memory block size on bare metal
Some of our servers spend significant time at kernel boot initializing
memory block sysfs directories and then creating symlinks between them and
the corresponding nodes.  The slowness happens because the machines get
stuck with the smallest supported memory block size on x86 (128M), which
results in 16,288 directories to cover the 2T of installed RAM.  The
search for each memory block is noticeable even with commit 4fb6eabf10
("drivers/base/memory.c: cache memory blocks in xarray to accelerate
lookup").

Commit 078eb6aa50 ("x86/mm/memory_hotplug: determine block size based on
the end of boot memory") chooses the block size based on alignment with
memory end.  That addresses hotplug failures in qemu guests, but for bare
metal systems whose memory end isn't aligned to even the smallest size, it
leaves them at 128M.

Make kernels that aren't running on a hypervisor use the largest supported
size (2G) to minimize overhead on big machines.  Kernel boot goes 7%
faster on the aforementioned servers, shaving off half a second.

[daniel.m.jordan@oracle.com: v3]
  Link: http://lkml.kernel.org/r/20200714205450.945834-1-daniel.m.jordan@oracle.com

Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Sistare <steven.sistare@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20200609225451.3542648-1-daniel.m.jordan@oracle.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-12 10:57:57 -07:00
..
pat x86/mm/pat: Mark an intentional data race 2020-06-29 12:04:47 -07:00
amdtopology.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
cpu_entry_area.c x86/entry: Remove DBn stacks 2020-06-11 15:15:23 +02:00
debug_pagetables.c mm: introduce include/linux/pgtable.h 2020-06-09 09:39:13 -07:00
dump_pagetables.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
extable.c x86/entry: Treat BUG/WARN as NMI-like entries 2020-06-12 12:12:57 +02:00
fault.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
highmem_32.c arch/kunmap_atomic: consolidate duplicate code 2020-06-04 19:06:22 -07:00
hugetlbpage.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
ident_map.c x86/mm: Stop pretending pgtable_l5_enabled is a variable 2018-05-19 11:56:57 +02:00
init.c x86/mm: Fix -Wmissing-prototypes warnings for arch/x86/mm/init.c 2020-06-17 10:45:46 +02:00
init_32.c A set of locking fixes and updates: 2020-08-10 19:07:44 -07:00
init_64.c x86/mm: use max memory block size on bare metal 2020-08-12 10:57:57 -07:00
iomap_32.c x86/mm/pat: Rename <asm/pat.h> => <asm/memtype.h> 2019-12-10 10:12:55 +01:00
ioremap.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
kasan_init_64.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
kaslr.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
kmmio.c Misc changes: 2020-06-05 11:18:53 -07:00
maccess.c maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault 2020-06-17 10:57:41 -07:00
Makefile kbuild: remove cc-option test of -fno-stack-protector 2020-07-07 11:13:10 +09:00
mem_encrypt.c x86/mm: Fix -Wmissing-prototypes warnings for arch/x86/mm/init.c 2020-06-17 10:45:46 +02:00
mem_encrypt_boot.S mm: introduce include/linux/pgtable.h 2020-06-09 09:39:13 -07:00
mem_encrypt_identity.c Merge branch 'x86-kdump-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-09 11:52:34 -07:00
mm_internal.h x86/mm: thread pgprot_t through init_memory_mapping() 2020-04-10 15:36:21 -07:00
mmap.c x86/mm/mmap: Fix -Wmissing-prototypes warnings 2020-04-22 20:19:48 +02:00
mmio-mod.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
numa.c x86/mm/numa: Remove uninitialized_var() usage 2020-07-16 12:32:25 -07:00
numa_32.c x86/mm: Drop deprecated DISCONTIGMEM support for 32-bit 2020-05-28 18:34:30 +02:00
numa_64.c mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
numa_emulation.c x86/mm: Mark setup_emu2phys_nid() static 2020-03-27 11:07:30 +01:00
numa_internal.h
pf_in.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pf_in.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pgtable.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
pgtable_32.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
physaddr.c mm, x86/mm: Untangle address space layout definitions from basic pgtable type definitions 2019-12-10 10:12:55 +01:00
physaddr.h
pkeys.c mm/vma: introduce VM_ACCESS_FLAGS 2020-04-10 15:36:21 -07:00
pti.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
setup_nx.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
srat.c
testmmiotrace.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
tlb.c Misc changes: 2020-06-05 11:18:53 -07:00