linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: rppt@kernel.org, akpm@linux-foundation.org, yajun.deng@linux.dev
Cc: linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>
Subject: [Patch v2 0/3] memblock: some fix for memmap_init_reserved_pages()
Date: Tue, 18 Mar 2025 07:19:45 +0000	[thread overview]
Message-ID: <20250318071948.23854-1-richard.weiyang@gmail.com> (raw)

During code review, I found we may leave some reserved region with invalid nid
when memblock_set_node() double the array. The patch set propose a fix and
test case.

Also I found memblock_set_node() accept size instead of end as second
parameter. Currently it is misused.

Patch 1: fix the second argument passed to memblock_set_node()
Patch 2: fix the invalid node id we may have in memmap_init_reserved_pages()
Patch 3: add a test case to verify it

v2: move check out side of the loop

Wei Yang (3):
  mm/memblock: pass size instead of end to memblock_set_node()
  mm/memblock: repeat setting reserved region nid if array is doubled
  memblock tests: add test for memblock_set_node

 mm/memblock.c                            |  12 ++-
 tools/testing/memblock/tests/basic_api.c | 102 +++++++++++++++++++++++
 2 files changed, 113 insertions(+), 1 deletion(-)

-- 
2.34.1



             reply	other threads:[~2025-03-18  7:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  7:19 Wei Yang [this message]
2025-03-18  7:19 ` [Patch v2 1/3] mm/memblock: pass size instead of end to memblock_set_node() Wei Yang
2025-03-18 10:29   ` Anshuman Khandual
2025-03-18  7:19 ` [Patch v2 2/3] mm/memblock: repeat setting reserved region nid if array is doubled Wei Yang
2025-03-18 10:55   ` Anshuman Khandual
2025-03-19  8:12     ` Wei Yang
2025-03-18  7:19 ` [Patch v2 3/3] memblock tests: add test for memblock_set_node Wei Yang
2025-04-07  2:58 ` [Patch v2 0/3] memblock: some fix for memmap_init_reserved_pages() Wei Yang
2025-04-07  6:34 ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250318071948.23854-1-richard.weiyang@gmail.com \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=yajun.deng@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox