mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] memblock: Remove unused exact nid allocation API
@ 2026-09-19 13:53 Kaitao Cheng
  2026-09-19 13:53 ` [PATCH v2 1/3] mm: Remove unused exact_nid parameter from memmap_alloc() Kaitao Cheng
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kaitao Cheng @ 2026-09-19 13:53 UTC (permalink / raw)
  To: Mike Rapoport, Andrew Morton, David Hildenbrand, Lorenzo Stoakes,
	Liam R . Howlett, Vlastimil Babka, Suren Baghdasaryan,
	Michal Hocko, Muchun Song
  Cc: Priyanshu Kumar, linux-mm, linux-kernel, Kaitao Cheng

Commit ffe55393137c ("mm/sparse: remove sparse buffer pre-allocation
mechanism") removed the only memmap_alloc() caller that requested an
allocation from an exact NUMA node. All remaining callers allow fallback
to other nodes, leaving the exact_nid argument unused.

Remove the argument from memmap_alloc(). This leaves
memblock_alloc_exact_nid_raw() without any in-kernel callers, so move the
applicable exact-node allocation tests to memblock_alloc_range_nid() and
remove the unused API. Also remove the exact_nid argument from the internal
allocation helper, since all of its remaining callers allow fallback.

Exact-node allocation remains a required behavior of
memblock_alloc_range_nid(). CMA uses it when reserving per-node CMA areas;
allowing fallback could leave the area's recorded nid inconsistent with
the physical location of its memory. KHO also uses it for per-node scratch
areas that must remain on the requested node. Therefore, retain coverage
of this behavior by making the applicable NUMA tests call
memblock_alloc_range_nid() directly with exact_nid set.

The tests that exercise memblock_alloc_internal() retrying below min_addr
cannot be retained unchanged. 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 along with the now
unused TEST_F_EXACT dispatch from the shared allocation tests.

Kaitao Cheng (3):
  mm: Remove unused exact_nid parameter from memmap_alloc()
  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 +-
 mm/mm_init.c                                  |  14 +-
 mm/mm_init.h                                  |   4 +-
 mm/sparse-vmemmap.c                           |   2 +-
 mm/sparse.c                                   |   2 +-
 .../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 -
 10 files changed, 50 insertions(+), 496 deletions(-)

-- 
2.54.0 (Apple Git-157)


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

end of thread, other threads:[~2026-09-19 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 13:53 [PATCH v2 0/3] memblock: Remove unused exact nid allocation API Kaitao Cheng
2026-09-19 13:53 ` [PATCH v2 1/3] mm: Remove unused exact_nid parameter from memmap_alloc() Kaitao Cheng
2026-09-19 13:53 ` [PATCH v2 2/3] memblock tests: Move exact nid tests to memblock_alloc_range_nid() Kaitao Cheng
2026-09-19 13:53 ` [PATCH v2 3/3] memblock: Remove unused memblock_alloc_exact_nid_raw() Kaitao Cheng

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®