mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] memblock: Remove unused exact nid allocation API
@ 2026-09-17  8:15 Kaitao Cheng
  2026-09-17  8:15 ` [PATCH 1/2] memblock tests: Move exact nid tests to memblock_alloc_range_nid() Kaitao Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kaitao Cheng @ 2026-09-17  8:15 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton, Muchun Song, Lorenzo Stoakes
  Cc: Priyanshu Kumar, linux-mm, linux-kernel, Kaitao Cheng

This series follows the removal of the unused exact_nid argument from
memmap_alloc(). That change removed the last in-kernel caller of
memblock_alloc_exact_nid_raw(), leaving only the memblock simulator
tests using the function.

The first patch moves the applicable exact-node allocation tests to
memblock_alloc_range_nid(). The second patch removes
memblock_alloc_exact_nid_raw() and drops the exact_nid argument from
memblock_alloc_internal(), as all of its remaining callers allow
fallback to other NUMA nodes.

The investigation cannot be extended to removing the exact_nid argument
from memblock_alloc_range_nid(). CMA passes true when reserving per-node
CMA areas. Allowing such an allocation to fall back to another node
could leave the CMA area's recorded nid inconsistent with the physical
location of its memory. KHO also passes true when allocating per-node
scratch areas and requires those allocations to remain on the requested
node.

Since exact-node allocation remains a required behavior of
memblock_alloc_range_nid(), deleting all of the tests in
alloc_exact_nid_api.c would remove useful coverage. Preserve the
applicable NUMA tests by making them call memblock_alloc_range_nid()
directly with exact_nid set.

Some tests cannot be preserved unchanged because they exercise
memblock_alloc_internal() retrying below min_addr. Unlike
memblock_alloc_internal(), memblock_alloc_range_nid() treats its start
address as a hard boundary and does not retry from address zero. Remove
those tests together with the now-unused TEST_F_EXACT dispatch from the
shared allocation tests.

Kaitao Cheng (2):
  memblock tests: Move exact nid tests to memblock_alloc_range_nid()
  memblock: Remove unused memblock_alloc_exact_nid_raw()

 include/linux/memblock.h                      |   3 -
 mm/memblock.c                                 |  44 +-
 .../memblock/tests/alloc_exact_nid_api.c      | 454 ++----------------
 tools/testing/memblock/tests/alloc_nid_api.c  |  20 -
 tools/testing/memblock/tests/alloc_nid_api.h  |   1 -
 tools/testing/memblock/tests/common.h         |   2 -
 6 files changed, 42 insertions(+), 482 deletions(-)

-- 
2.54.0 (Apple Git-157)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-17  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17  8:15 [PATCH 0/2] memblock: Remove unused exact nid allocation API Kaitao Cheng
2026-09-17  8:15 ` [PATCH 1/2] memblock tests: Move exact nid tests to memblock_alloc_range_nid() Kaitao Cheng
2026-09-17  8:15 ` [PATCH 2/2] memblock: Remove unused memblock_alloc_exact_nid_raw() Kaitao Cheng
2026-09-17  9:44 ` [PATCH 0/2] memblock: Remove unused exact nid allocation API Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®