mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/page_alloc: fix lazy memory acceptance before watermarks are set
@ 2026-11-30 17:26 Pankaj Gupta
  2026-11-30 17:26 ` [PATCH 1/2] mm/page_alloc: rename cond_accept_memory() to accept_memory_to_wmark() Pankaj Gupta
  2026-11-30 17:26 ` [PATCH 2/2] mm/page_alloc: do not accept memory proactively before watermarks are set Pankaj Gupta
  0 siblings, 2 replies; 3+ messages in thread
From: Pankaj Gupta @ 2026-11-30 17:26 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Johannes Weiner
  Cc: Suren Baghdasaryan, Michal Hocko, Brendan Jackman, Zi Yan,
	Kiryl Shutsemau, Tom Lendacky, Farrah Chen, linux-mm,
	linux-kernel, pankaj.gupta.linux, Pankaj Gupta

Lazy memory acceptance should accept memory only when it is needed.
Since commit 800f1059c99e ("mm/page_alloc: fix memory accept before
watermarks gets initialized"), one MAX_PAGE_ORDER page is accepted on
every page allocation until the zone watermarks are set. On a 19 GiB
SEV-SNP guest this accepts about ~14 GiB during boot and hence reduce the
boot time.

Patch 1 renames cond_accept_memory() to accept_memory_to_wmark().

Patch 2 accepts memory before the watermarks are set only when an
allocation cannot be satisfied.

SEV-SNP guest with 19 GiB of memory, memory left unaccepted after boot,
before and after this change:

             before      after
  4 vCPUs    3.1 GiB     14.7 GiB
 64 vCPUs    2.8 GiB     13.9 GiB

This also reduces the boot time of the guest.

Pankaj Gupta (2):
  mm/page_alloc: rename cond_accept_memory() to accept_memory_to_wmark()
  mm/page_alloc: do not accept memory proactively before watermarks are
    set

 mm/page_alloc.c | 59 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 17 deletions(-)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-30 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 17:26 [PATCH 0/2] mm/page_alloc: fix lazy memory acceptance before watermarks are set Pankaj Gupta
2026-11-30 17:26 ` [PATCH 1/2] mm/page_alloc: rename cond_accept_memory() to accept_memory_to_wmark() Pankaj Gupta
2026-11-30 17:26 ` [PATCH 2/2] mm/page_alloc: do not accept memory proactively before watermarks are set Pankaj Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®