linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM
@ 2025-11-27  9:25 Jinhui Guo
  2025-11-27  9:46 ` David Hildenbrand (Red Hat)
  0 siblings, 1 reply; 4+ messages in thread
From: Jinhui Guo @ 2025-11-27  9:25 UTC (permalink / raw)
  To: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, fvdl
  Cc: guojinhui.liam, linux-mm, linux-kernel

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@bytedance.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)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM
  2025-11-27  9:25 [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM Jinhui Guo
@ 2025-11-27  9:46 ` David Hildenbrand (Red Hat)
  2025-11-27 10:29   ` Mike Rapoport
  2025-11-27 12:14   ` Jinhui Guo
  0 siblings, 2 replies; 4+ messages in thread
From: David Hildenbrand (Red Hat) @ 2025-11-27  9:46 UTC (permalink / raw)
  To: Jinhui Guo, akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt,
	surenb, mhocko, fvdl
  Cc: linux-mm, linux-kernel

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@bytedance.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?

-- 
Cheers

David


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM
  2025-11-27  9:46 ` David Hildenbrand (Red Hat)
@ 2025-11-27 10:29   ` Mike Rapoport
  2025-11-27 12:14   ` Jinhui Guo
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Rapoport @ 2025-11-27 10:29 UTC (permalink / raw)
  To: David Hildenbrand (Red Hat)
  Cc: Jinhui Guo, akpm, lorenzo.stoakes, Liam.Howlett, vbabka, surenb,
	mhocko, fvdl, linux-mm, linux-kernel

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@bytedance.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?

Some of these are used only in sparse.c and sparse-vmmemap.c so with
CONFIG_SPARSE=n they are completely unused.

We probably should move them to mm/internal.h or even mm/sparse.h
 
> -- 
> Cheers
> David

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM
  2025-11-27  9:46 ` David Hildenbrand (Red Hat)
  2025-11-27 10:29   ` Mike Rapoport
@ 2025-11-27 12:14   ` Jinhui Guo
  1 sibling, 0 replies; 4+ messages in thread
From: Jinhui Guo @ 2025-11-27 12:14 UTC (permalink / raw)
  To: david
  Cc: Liam.Howlett, akpm, fvdl, guojinhui.liam, linux-kernel, linux-mm,
	lorenzo.stoakes, mhocko, rppt, surenb

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@bytedance.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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-27 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-27  9:25 [PATCH] mm/sparse: Fix sparse_vmemmap_init_nid_early definition without CONFIG_SPARSEMEM Jinhui Guo
2025-11-27  9:46 ` David Hildenbrand (Red Hat)
2025-11-27 10:29   ` Mike Rapoport
2025-11-27 12:14   ` Jinhui Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox