Skip to content

Parallel struct page initialisation v4

Mel Gorman linux-mm linux-nvdimm lkml nvdimm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 41 repliesIn review

Changelog since v3 from the cover letter

o Fix section-related warning
o Comments, clarifications, checkpatch
o Report the number of pages initialised

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13memblock: Introduce a for_each_reserved_mem_region iterator.include/linux/memblock.h mm/memblock.c+50 -00 replies
2/13mm: meminit: Move page initialization into a separate function.mm/page_alloc.c+46 -330 replies
3/13mm: meminit: Only set page reserved in the memblock regioninclude/linux/mm.h mm/nobootmem.c mm/page_alloc.c+21 -12 replies
4/13mm: page_alloc: Pass PFN to __free_pages_bootmemmm/bootmem.c mm/internal.h mm/memblock.c +2 more+11 -91 reply
5/13mm: 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+51 -300 replies
6/13mm: meminit: Inline some helper functionsinclude/linux/mmzone.h mm/page_alloc.c+39 -464 replies
7/13mm: meminit: Initialise a subset of struct pages if CONFIG_DEFERRED_STRUCT_PAGE_INIT is setdrivers/base/node.c include/linux/mmzone.h mm/Kconfig +2 more+120 -46 replies
8/13mm: meminit: Initialise remaining struct pages in parallel with kswapdmm/internal.h mm/mm_init.c mm/page_alloc.c +1 more+130 -60 replies
9/13mm: meminit: Minimise number of pfn->page lookups during initialisationmm/page_alloc.c+24 -50 replies
10/13x86: mm: Enable deferred struct page initialisation on x86-64arch/x86/Kconfig+1 -00 replies
11/13mm: meminit: Free pages in large chunks where possiblemm/page_alloc.c+49 -60 replies
12/13mm: meminit: Reduce number of times pageblocks are set during struct page initmm/page_alloc.c+24 -221 reply
13/13mm: meminit: Remove mminit_verify_page_linksmm/internal.h mm/mm_init.c mm/page_alloc.c+0 -170 replies

Reviews trailers per patch

None of the 13 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPekka Enberg
SeriesA-b
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/13] Parallel struct page initialisation v4

The bulk of the changes here are related to Andrew's feedback. Functionally there is almost no difference.

Changelog since v3
o Fix section-related warning
o Comments, clarifications, checkpatch
o Report the number of pages initialised

Changelog since v2
o Reduce overhead of topology_init
o Remove boot-time kernel parameter to enable/disable
o Enable on UMA

Changelog since v1
o Always initialise low zones
o Typo corrections
o Rename parallel mem init to parallel struct page init
o Rebase to 4.0

Struct page 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 to defer initialisation until they were first used. This was rejected on the grounds it should not be necessary to hurt the fast paths. 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.

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

[    8.406511] kswapd 3 initialised deferred memory in 1116ms
[    8.428518] kswapd 1 initialised deferred memory in 1140ms
[    8.435977] kswapd 0 initialised deferred memory in 1148ms
[    8.437416] kswapd 2 initialised deferred memory in 1148ms

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 16 seconds.

It would be nice if the people that have access to really large machines would test this series and report how much boot time is reduced.

 arch/ia64/mm/numa.c      |  19 +--
 arch/x86/Kconfig         |   1 +
 drivers/base/node.c      |   6 +-
 include/linux/memblock.h |  18 +++
 include/linux/mm.h       |   8 +-
 include/linux/mmzone.h   |  23 ++-
 mm/Kconfig               |  18 +++
 mm/bootmem.c             |   8 +-
 mm/internal.h            |  29 +++-
 mm/memblock.c            |  34 +++-
 mm/mm_init.c             |   9 +-
 mm/nobootmem.c           |   7 +-
 mm/page_alloc.c          | 401 ++++++++++++++++++++++++++++++++++++++++-------
 mm/vmscan.c              |   6 +-
 14 files changed, 487 insertions(+), 100 deletions(-)
Signature · 7 lines
2.3.5

--
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>