Skip to content

memblock: Remove unused exact nid allocation API

Kaitao Cheng linux-mm lkml 2 versions – Applied

Status from this message: Applied to for-next branch of memblock.git tree, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesApplied
  2. v12 patches 1 replySuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3mm: Remove unused exact_nid parameter from memmap_alloc()mm/mm_init.c mm/mm_init.h mm/sparse-vmemmap.c +1 more+8 -140 replies
2/3memblock tests: Move exact nid tests to memblock_alloc_range_nid()tools/testing/memblock/tests/alloc_exact_nid_api.c tools/testing/memblock/tests/alloc_nid_api.c tools/testing/memblock/tests/alloc_nid_api.h +1 more+37 -4400 replies
3/3memblock: Remove unused memblock_alloc_exact_nid_raw()include/linux/memblock.h mm/memblock.c+5 -420 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] memblock: Remove unused exact nid allocation API

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(-)
Signature · 1 line
2.54.0 (Apple Git-157)