Skip to content

Commit 2df79e4

Browse files
committed
Merge tag 'fixes-2025-11-19' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
Pull memblock fix from Mike Rapoport: "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" * tag 'fixes-2025-11-19' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: fix memblock_estimated_nr_free_pages() for soft-reserved memory
2 parents 8b69055 + c42af83 commit 2df79e4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mm/memblock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,8 @@ phys_addr_t __init_memblock memblock_reserved_kern_size(phys_addr_t limit, int n
18261826
*/
18271827
unsigned long __init memblock_estimated_nr_free_pages(void)
18281828
{
1829-
return PHYS_PFN(memblock_phys_mem_size() - memblock_reserved_size());
1829+
return PHYS_PFN(memblock_phys_mem_size() -
1830+
memblock_reserved_kern_size(MEMBLOCK_ALLOC_ANYWHERE, NUMA_NO_NODE));
18301831
}
18311832

18321833
/* lowest address */

0 commit comments

Comments
 (0)