Re: [PATCH] mm/mm_init: avoid overflow in percentage-based core sizing

From: Mike Rapoport

Date: Sat Nov 07 2026 - 06:04:13 EST


From: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

On Fri, 06 Nov 2026 09:23:55 +0200, Avi Weiss wrote:
> The kernelcore= and movablecore= percentage calculations multiply the
> total number of pages before dividing. On 32-bit kernels, the
> intermediate unsigned long product can overflow, producing incorrect
> memory zone boundaries. With 2 GiB of RAM and kernelcore=100%, a
> 32-bit HIGHMEM kernel incorrectly creates ZONE_MOVABLE.
>
> Use mult_frac() to calculate both percentages without overflowing
> the intermediate product.
>
> [...]

Applied to for-next branch of memblock.git tree, thanks!

[1/1] mm/mm_init: avoid overflow in percentage-based core sizing
commit: 36557d74a757a4bb71bb1492449680177687f5a1

tree: https://git.kernel.org/pub/scm/linux/kernel/git/mm/memblock
branch: for-next

--
Sincerely yours,
Mike.