[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aAyXzywgqH2qFRKn@kernel.org>
Date: Sat, 26 Apr 2025 11:22:39 +0300
From: Mike Rapoport <rppt@...nel.org>
To: "Bernardo C. Gutierrez Cantu" <bercantu@...zon.de>
Cc: akpm@...ux-foundation.org, dwmw2@...radead.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, lkp@...el.com,
yajun.deng@...ux.dev
Subject: Re: [PATCH] mm: memblock: Fix arguments passed to memblock_set_node()
Hi Bernardo,
On Fri, Apr 25, 2025 at 10:20:03AM +0000, Bernardo C. Gutierrez Cantu wrote:
> memblock_set_node() receives a `base` and a `size` arguments, but we are
> passing the `start` and `end` of the memory regions when iterating over
> them in memmap_init_reserved_pages() to set their node ids.
>
> This results in the function setting the node ids for the reserved memory
> regions in `[base, base + base + size)` instead of `[base, base + size)`.
>
> Pass `start` and `size`, so that we iterate over the correct range.
>
> Fixes: 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()")
>
> Signed-off-by: Bernardo C. Gutierrez Cantu <bercantu@...zon.de>
There's already a fix in memblock tree:
https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git/commit/?h=for-next&id=06eaa824fd239edd1eab2754f29b2d03da313003
Will send PR to Linus soon.
> ---
> mm/memblock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 0a53db4d9f7b..9639f04b4fdf 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2196,7 +2196,7 @@ static void __init memmap_init_reserved_pages(void)
> if (memblock_is_nomap(region))
> reserve_bootmem_region(start, end, nid);
>
> - memblock_set_node(start, end, &memblock.reserved, nid);
> + memblock_set_node(start, region->size, &memblock.reserved, nid);
> }
>
> /*
> --
> 2.47.1
--
Sincerely yours,
Mike.
Powered by blists - more mailing lists