From: Mike Rapoport <rppt@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>
Cc: Alexander Graf <graf@amazon.com>,
Alexander Potapenko <glider@google.com>,
Brendan Jackman <jackmanb@google.com>,
Christoph Lameter <cl@gentwo.org>,
Dennis Zhou <dennis@kernel.org>,
Dmitry Vyukov <dvyukov@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
"Liam R. Howlett" <liam@infradead.org>,
Lorenzo Stoakes <ljs@kernel.org>, Marco Elver <elver@google.com>,
Michal Hocko <mhocko@suse.com>,
Muchun Song <muchun.song@linux.dev>,
Oscar Salvador <osalvador@suse.de>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
Suren Baghdasaryan <surenb@google.com>, Tejun Heo <tj@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Vlastimil Babka <vbabka@kernel.org>, Zi Yan <ziy@nvidia.com>,
kasan-dev@googlegroups.com, kexec@lists.infradead.org,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v2 1/3] mm: split out mm_init and memblock declarations from internal.h
Date: Sat, 11 Jul 2026 18:14:28 +0300 [thread overview]
Message-ID: <alJd1BLypyK9Mpaw@kernel.org> (raw)
In-Reply-To: <20260709-internal-h-v2-1-695631425968@kernel.org>
On Thu, Jul 09, 2026 at 01:00:03PM +0300, Mike Rapoport (Microsoft) wrote:
> mm/internal.h becomes more and more bloated.
>
> Move declarations for related to mm/mm_init.c and mm/memblock.c to a new
> mm/mm_init.h header.
>
> No functional changes.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> Acked-by: Muchun Song <muchun.song@linux.dev>
> ---
> MAINTAINERS | 1 +
> kernel/liveupdate/kexec_handover.c | 1 +
> mm/cma.c | 1 +
> mm/hugetlb.c | 1 +
> mm/internal.h | 91 ----------------------------
> mm/memblock.c | 1 +
> mm/memory_hotplug.c | 1 +
> mm/mm_init.c | 1 +
> mm/mm_init.h | 120 +++++++++++++++++++++++++++++++++++++
> mm/page_alloc.c | 1 +
> mm/sparse-vmemmap.c | 1 +
> mm/sparse.c | 1 +
> 12 files changed, 130 insertions(+), 91 deletions(-)
As always I forgot to update the memblock tests :(
Andrew, can you please merge this as a fixup:
From 4724f0868aa5ab6bc1c054d0be1cca2067533c22 Mon Sep 17 00:00:00 2001
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
Date: Sat, 11 Jul 2026 18:11:13 +0300
Subject: [PATCH] memblock tests: split stubfs from internal.h to mm_init.h
Following the split of declarations from mm/internal.h to mm/mm_init.h
update memblock tests to match the kernel core, otherwise they fail to
build.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
tools/testing/memblock/internal.h | 20 --------------------
tools/testing/memblock/mm_init.h | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 20 deletions(-)
create mode 100644 tools/testing/memblock/mm_init.h
diff --git a/tools/testing/memblock/internal.h b/tools/testing/memblock/internal.h
index b6b1d147fd75..4168e646af09 100644
--- a/tools/testing/memblock/internal.h
+++ b/tools/testing/memblock/internal.h
@@ -28,22 +28,6 @@ static inline struct page *virt_to_page(void *virt)
return virt;
}
-void memblock_free_pages(unsigned long pfn, unsigned int order)
-{
-}
-
-static inline void accept_memory(phys_addr_t start, unsigned long size)
-{
-}
-
-unsigned long free_reserved_area(void *start, void *end, int poison, const char *s);
-void free_reserved_page(struct page *page);
-
-static inline bool deferred_pages_enabled(void)
-{
- return false;
-}
-
#define for_each_valid_pfn(pfn, start_pfn, end_pfn) \
for ((pfn) = (start_pfn); (pfn) < (end_pfn); (pfn)++)
@@ -60,10 +44,6 @@ static inline bool __is_kernel(unsigned long addr)
#define for_each_valid_pfn(pfn, start_pfn, end_pfn) \
for ((pfn) = (start_pfn); (pfn) < (end_pfn); (pfn)++)
-static inline void init_deferred_page(unsigned long pfn, int nid)
-{
-}
-
#define __SetPageReserved(p) ((void)(p))
#endif
diff --git a/tools/testing/memblock/mm_init.h b/tools/testing/memblock/mm_init.h
new file mode 100644
index 000000000000..95bc5f2e8ed8
--- /dev/null
+++ b/tools/testing/memblock/mm_init.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef __MM_MM_INIT_H
+#define __MM_MM_INIT_H
+
+void memblock_free_pages(unsigned long pfn, unsigned int order)
+{
+}
+
+static inline void accept_memory(phys_addr_t start, unsigned long size)
+{
+}
+
+unsigned long free_reserved_area(void *start, void *end, int poison, const char *s);
+void free_reserved_page(struct page *page);
+
+static inline bool deferred_pages_enabled(void)
+{
+ return false;
+}
+
+static inline void init_deferred_page(unsigned long pfn, int nid)
+{
+}
+#endif /* __MM_MM_INIT_H */
--
2.53.0
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-07-11 15:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 10:00 [PATCH v2 0/3] mm: split a couple of headers from internal.h Mike Rapoport (Microsoft)
2026-07-09 10:00 ` [PATCH v2 1/3] mm: split out mm_init and memblock declarations " Mike Rapoport (Microsoft)
2026-07-11 15:14 ` Mike Rapoport [this message]
2026-07-09 10:00 ` [PATCH v2 2/3] mm: split out sparse " Mike Rapoport (Microsoft)
2026-07-09 10:00 ` [PATCH v2 3/3] mm: split out vmalloc " Mike Rapoport (Microsoft)
2026-07-09 10:09 ` [PATCH v2 0/3] mm: split a couple of headers " Vlastimil Babka (SUSE)
2026-07-09 10:21 ` David Hildenbrand (Arm)
2026-07-09 15:36 ` Lorenzo Stoakes
2026-07-09 12:59 ` Pratyush Yadav
2026-07-10 0:13 ` SJ Park
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=alJd1BLypyK9Mpaw@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=david@kernel.org \
--cc=dennis@kernel.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=graf@amazon.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kexec@lists.infradead.org \
--cc=liam@infradead.org \
--cc=linux-cxl@vger.kernel.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=osalvador@suse.de \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=urezki@gmail.com \
--cc=vbabka@kernel.org \
--cc=ziy@nvidia.com \
/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.