From: Kaitao Cheng <kaitao.cheng@linux.dev>
To: Mike Rapoport <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R . Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Muchun Song <muchun.song@linux.dev>
Cc: Priyanshu Kumar <priyanshukumarpu@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Kaitao Cheng <kaitao.cheng@linux.dev>
Subject: [PATCH v2 0/3] memblock: Remove unused exact nid allocation API
Date: Sat, 19 Sep 2026 21:53:24 +0800 [thread overview]
Message-ID: <20260919135327.74089-1-kaitao.cheng@linux.dev> (raw)
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)
next reply other threads:[~2026-09-19 13:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 13:53 Kaitao Cheng [this message]
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
2026-09-24 7:48 ` [PATCH v2 0/3] memblock: Remove unused exact nid allocation API Mike Rapoport
2026-10-12 3:06 ` Kaitao Cheng
2026-10-13 9:50 ` Mike Rapoport
2026-10-13 10:06 ` Muchun Song
2026-10-13 17:27 ` 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=20260919135327.74089-1-kaitao.cheng@linux.dev \
--to=kaitao.cheng@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=priyanshukumarpu@gmail.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.