Re: [PATCH v1] mm: initialize pages on demand during boot

From: Andrew Morton
Date: Fri Jan 12 2018 - 18:37:42 EST


On Fri, 12 Jan 2018 13:34:05 -0500 Pavel Tatashin <pasha.tatashin@xxxxxxxxxx> wrote:

> Deferred page initialization allows the boot cpu to initialize a small
> subset of the system's pages early in boot, with other cpus doing the rest
> later on.
>
> It is, however, problematic to know how many pages the kernel needs during
> boot. Different modules and kernel parameters may change the requirement,
> so the boot cpu either initializes too many pages or runs out of memory.
>
> To fix that, initialize early pages on demand. This ensures the kernel
> does the minimum amount of work to initialize pages during boot and leaves
> the rest to be divided in the multithreaded initialization path
> (deferred_init_memmap).
>
> The on-demand code is permanently disabled using static branching once
> deferred pages are initialized. After the static branch is changed to
> false, the overhead is up-to two branch-always instructions if the zone
> watermark check fails or if rmqueue fails.

Presumably this fixes some real-world problem which someone has observed?

Please describe that problem for us in lavish detail.