Re: [PATCH] mm/page_alloc: Fix memory accept before watermarks gets initialized

From: Kirill A. Shutemov
Date: Mon Mar 10 2025 - 08:07:33 EST


On Mon, Mar 10, 2025 at 12:37:25PM +0100, Vlastimil Babka wrote:
> On 3/10/25 09:28, Kirill A. Shutemov wrote:
> > Watermarks are initialized during the postcore initcall. Until then, all
> > watermarks are set to zero. This causes cond_accept_memory() to
> > incorrectly skip memory acceptance because a watermark of 0 is always
> > met.
>
> What are the user-visible consequences of that?

Premature OOM on boot.

It can be triggered with certain combinations of number of vCPUs and
memory size.

> > To ensure progress, accept one MAX_ORDER page if the watermark is zero.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> > Reported-and-tested-by: Farrah Chen <farrah.chen@xxxxxxxxx>
>
> Fixes:, Cc: stable etc?

Fixes: dcdfdd40fa82 ("mm: Add support for unaccepted memory")
Cc: stable@@vger.kernel.org # v6.5+

--
Kiryl Shutsemau / Kirill A. Shutemov