mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kaitao Cheng <kaitao.cheng@linux.dev>
To: Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Muchun Song <muchun.song@linux.dev>,
	Lorenzo Stoakes <ljs@kernel.org>
Cc: Priyanshu Kumar <priyanshukumarpu@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kaitao Cheng <kaitao.cheng@linux.dev>
Subject: [PATCH 0/2] memblock: Remove unused exact nid allocation API
Date: Thu, 17 Sep 2026 16:15:02 +0800	[thread overview]
Message-ID: <20260917081504.30426-1-kaitao.cheng@linux.dev> (raw)

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)


             reply	other threads:[~2026-09-17  8:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  8:15 Kaitao Cheng [this message]
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

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=20260917081504.30426-1-kaitao.cheng@linux.dev \
    --to=kaitao.cheng@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=priyanshukumarpu@gmail.com \
    --cc=rppt@kernel.org \
    /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

all inboxes | Powered by JetHome®