memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory
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.
The pull request you sent on Wed, 19 Nov 2025 09:08:33 +0200:
The pull request you sent on Wed, 19 Nov 2025 09:08:33 +0200:
Quoted 1 line
https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock fixes-2025-11-19
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2df79e4d729cc67395db2fd6965148fea0851898
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html