Skip to contentSkip to conversation

memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory

GIT PULL Merged Mike Rapoport 2 participants 2 messages Nov 19, 2025 Memory management

lore
Share & tools
lore
#0 lore raw

Hi Linus,

The following changes since commit e9a6fb0bcdd7609be6969112f3fbfcce3b1d4a7c:

Linux 6.18-rc5 (2025-11-09 15:10:19 -0800)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock fixes-2025-11-19

for you to fetch changes up to c42af83c59b65d01c0f7a074e450bbbb43b22f0d:

memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory (2025-11-11 18:15:35 +0200)

----------------------------------------------------------------
memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory

The "soft-reserved" memory regions (EFI_MEMORY_SP) are added to the memblock.reserved, but not to the memblock.memory. It causes memblock_estimated_nr_free_pages() to return a value smaller value than expected, or if it underflows, an extremely large value.

Calculate the number of estimated free pages using memblock_reserved_kern_size() instead of memblock_reserved_size() to fix the issue.

----------------------------------------------------------------
Akinobu Mita (1):
memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory

 mm/memblock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 2 lines
Sincerely yours,
Mike.