Skip to content

RFC Parallel memory initialisation

Mel Gorman linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14memblock: Introduce a for_each_reserved_mem_region iterator.include/linux/memblock.h mm/memblock.c+50 -00 replies
2/14mm: meminit: Move page initialization into a separate function.mm/page_alloc.c+46 -330 replies
3/14mm: meminit: Only set page reserved in the memblock regioninclude/linux/mm.h mm/nobootmem.c mm/page_alloc.c+15 -10 replies
4/14mm: page_alloc: Pass PFN to __free_pages_bootmemmm/bootmem.c mm/internal.h mm/memblock.c +2 more+10 -80 replies
5/14mm: meminit: Make __early_pfn_to_nid SMP-safe and introduce meminit_pfn_in_nidarch/ia64/mm/numa.c include/linux/mm.h include/linux/mmzone.h +1 more+53 -300 replies
6/14mm: meminit: Inline some helper functionsinclude/linux/mm.h include/linux/mmzone.h mm/page_alloc.c+35 -480 replies
7/14mm: meminit: Partially initialise memory if CONFIG_DEFERRED_MEM_INIT is setinclude/linux/mmzone.h mm/internal.h mm/page_alloc.c+89 -30 replies
8/14mm: meminit: Initialise remaining memory in parallel with kswapdmm/internal.h mm/mm_init.c mm/page_alloc.c +1 more+123 -60 replies
9/14mm: meminit: Minimise number of pfn->page lookups during initialisationmm/page_alloc.c+24 -50 replies
10/14x86: mm: Enable deferred memory initialisation on x86-64arch/x86/Kconfig mm/Kconfig+21 -01 reply
11/14mm: meminit: Control parallel memory initialisation from command line and configDocumentation/kernel-parameters.txt include/linux/mmzone.h init/main.c +2 more+57 -00 replies
12/14mm: meminit: Free pages in large chunks where possiblemm/page_alloc.c+41 -50 replies
13/14mm: meminit: Reduce number of times pageblocks are set during initialisationmm/page_alloc.c+23 -220 replies
14/14mm: meminit: Remove mminit_verify_page_linksmm/internal.h mm/mm_init.c mm/page_alloc.c+0 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/14] Parallel memory initialisation

Memory initialisation had been identified as one of the reasons why large machines take a long time to boot. Patches were posted a long time ago that attempted to move deferred initialisation into the page allocator paths. This was rejected on the grounds it should not be necessary to hurt the fast paths to parallelise initialisation. This series reuses much of the work from that time but defers the initialisation of memory to kswapd so that one thread per node initialises memory local to that node. The issue is that on the machines I tested with, memory initialisation was not a major contributor to boot times. I'm posting the RFC to both review the series and see if it actually helps users of very large machines.

After applying the series and setting the appropriate Kconfig variable I see this in the boot log on a 64G machine

[    7.383764] kswapd 0 initialised deferred memory in 188ms
[    7.404253] kswapd 1 initialised deferred memory in 208ms
[    7.411044] kswapd 3 initialised deferred memory in 216ms
[    7.411551] kswapd 2 initialised deferred memory in 216ms

On a 1TB machine, I see

[   11.913324] kswapd 0 initialised deferred memory in 1168ms
[   12.220011] kswapd 2 initialised deferred memory in 1476ms
[   12.245369] kswapd 3 initialised deferred memory in 1500ms
[   12.271680] kswapd 1 initialised deferred memory in 1528ms

Once booted the machine appears to work as normal. Boot times were measured from the time shutdown was called until ssh was available again. In the 64G case, the boot time savings are negligible. On the 1TB machine, the savings were 10 seconds (about 8% improvement on kernel times but 1-2% overall as POST takes so long).

It would be nice if the people that have access to really large machines would test this series and report back if the complexity is justified.

Patches are against 4.0-rc7.

 Documentation/kernel-parameters.txt |   8 +
 arch/ia64/mm/numa.c                 |  19 +-
 arch/x86/Kconfig                    |   2 +
 include/linux/memblock.h            |  18 ++
 include/linux/mm.h                  |   8 +-
 include/linux/mmzone.h              |  37 +++-
 init/main.c                         |   1 +
 mm/Kconfig                          |  29 +++
 mm/bootmem.c                        |   6 +-
 mm/internal.h                       |  23 ++-
 mm/memblock.c                       |  34 ++-
 mm/mm_init.c                        |   9 +-
 mm/nobootmem.c                      |   7 +-
 mm/page_alloc.c                     | 398 +++++++++++++++++++++++++++++++-----
 mm/vmscan.c                         |   6 +-
 15 files changed, 507 insertions(+), 98 deletions(-)
Signature · 7 lines
2.1.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>