[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251127121410.357-1-guojinhui.liam@bytedance.com>
Date: Thu, 27 Nov 2025 20:14:10 +0800
From: "Jinhui Guo" <guojinhui.liam@...edance.com>
To: <david@...nel.org>
Cc: <Liam.Howlett@...cle.com>, <akpm@...ux-foundation.org>,
<fvdl@...gle.com>, <guojinhui.liam@...edance.com>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<lorenzo.stoakes@...cle.com>, <mhocko@...e.com>, <rppt@...nel.org>,
<surenb@...gle.com>
Subject: Re: [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM
Hi, David
On Thu, Nov 27, 2025 at 10:46:54AM +0100, David Hildenbrand (Red Hat) wrote:
> On 11/27/25 10:25, Jinhui Guo wrote:
> > When CONFIG_SPARSEMEM is disabled, the macro
> > sparse_vmemmap_init_nid_early(_nid, _use) passes
> > two arguments, while the actual function accepts
> > only nid. Drop the extra argument _use.
> >
> > Fixes: d65917c42373 ("mm/sparse: allow for alternate vmemmap section init at boot")
> > Signed-off-by: Jinhui Guo <guojinhui.liam@...edance.com>
> > ---
> > include/linux/mmzone.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> > index 7fb7331c5725..f6dd181a4821 100644
> > --- a/include/linux/mmzone.h
> > +++ b/include/linux/mmzone.h
> > @@ -2293,7 +2293,7 @@ void sparse_init(void);
> > #else
> > #define sparse_init() do {} while (0)
> > #define sparse_index_init(_sec, _nid) do {} while (0)
> > -#define sparse_vmemmap_init_nid_early(_nid, _use) do {} while (0)
> > +#define sparse_vmemmap_init_nid_early(_nid) do {} while (0)
> > #define sparse_vmemmap_init_nid_late(_nid) do {} while (0)
> > #define pfn_in_present_section pfn_valid
> > #define subsection_map_init(_pfn, _nr_pages) do {} while (0)
>
> That commit is from early 2025.
>
> So what are the symptoms we are fixing? I would have assumed a compile-time
> problem, but no built bot caught that?
I spotted the issue while porting the patches. It’s harmless. Both
sparse_index_init() and sparse_vmemmap_init_nid_early() are only
referenced in mm/sparse.c and mm/sparse-vmemmap.c. So they can simply
be deleted from include/linux/mmzone.h when CONFIG_SPARSEMEM is disabled.
> --
> Cheers
> David
--
Best regards,
Jinhui
Powered by blists - more mailing lists