Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kernel test robot <lkp@intel.com>,
	David Hildenbrand <david@kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	mm-commits@vger.kernel.org,
	Muchun Song <songmuchun@bytedance.com>
Subject: Re: [akpm-mm:mm-new] BUILD REGRESSION 0bffe67ab8a72b3725cc31c4b525709bd3a3e223
Date: Thu, 10 Sep 2026 10:43:41 +0800	[thread overview]
Message-ID: <AA5FC896-AC1B-4112-BA14-E1F8865358BF@linux.dev> (raw)
In-Reply-To: <20260909153653.9e19f1d1f61a080d5bd6d2e5@linux-foundation.org>



> On Sep 10, 2026, at 06:36, Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> On Thu, 10 Sep 2026 05:56:22 +0800 kernel test robot <lkp@intel.com> wrote:
> 
>> tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
>> branch HEAD: 0bffe67ab8a72b3725cc31c4b525709bd3a3e223  mm/swap, PM: hibernate: atomically replace hibernation pin
>> 
>> Error/Warning (recently discovered and may have been fixed):
>> 
>>    https://lore.kernel.org/oe-kbuild-all/202609100351.ALNh2KwC-lkp@intel.com
>> 
>>    include/linux/mmzone.h:1692:10: error: call to undeclared function 'NODE_DATA'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>>    include/linux/mmzone.h:1692:26: error: member reference type 'int' is not a pointer
>>    include/linux/mmzone.h:1780:35: error: conflicting types for 'NODE_DATA'
>> 
>> Error/Warning ids grouped by kconfigs:
> 
> Thanks.  That's Muchun's "mm/sparse-vmemmap: switch device DAX to
> shared tail vmemmap pages" not liking CONFIG_NUMA=n.
> 
> I'll try this nasty thing for now.  Muchun, please make it less nasty!


My bad.

device_zone() uses NODE_DATA() before it is defined when CONFIG_NUMA
is disabled. This causes non-NUMA builds with CONFIG_ZONE_DEVICE=y to
fail.

Move device_zone() after the definition of NODE_DATA() so it is available
in non-NUMA builds.

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 03ed9232f186..df42fbf3962a 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -1686,21 +1686,11 @@ static inline bool zone_is_zone_device(const struct zone *zone)
 {
        return zone_idx(zone) == ZONE_DEVICE;
 }
-
-static inline struct zone *device_zone(int nid)
-{
-       return &NODE_DATA(nid)->node_zones[ZONE_DEVICE];
-}
 #else
 static inline bool zone_is_zone_device(const struct zone *zone)
 {
        return false;
 }
-
-static inline struct zone *device_zone(int nid)
-{
-       return NULL;
-}
 #endif

 /*
@@ -2159,11 +2149,21 @@ static inline int online_device_section(const struct mem_section *section)

        return section && ((section->section_mem_map & flags) == flags);
 }
+
+static inline struct zone *device_zone(int nid)
+{
+       return &NODE_DATA(nid)->node_zones[ZONE_DEVICE];
+}
 #else
 static inline int online_device_section(const struct mem_section *section)
 {
        return 0;
 }
+
+static inline struct zone *device_zone(int nid)
+{
+       return NULL;
+}
 #endif

 static inline int online_section_nr(unsigned long nr)

> 
> --- a/include/linux/mmzone.h~mm-sparse-vmemmap-switch-device-dax-to-shared-tail-vmemmap-pages-fix
> +++ a/include/linux/mmzone.h
> @@ -1687,16 +1687,20 @@ static inline bool zone_is_zone_device(c
> return zone_idx(zone) == ZONE_DEVICE;
> }
> 
> +#ifdef CONFIG_NUMA
> static inline struct zone *device_zone(int nid)
> {
> 	return &NODE_DATA(nid)->node_zones[ZONE_DEVICE];
> }
> +#endif
> #else
> static inline bool zone_is_zone_device(const struct zone *zone)
> {
> 	return false;
> }
> +#endif
> 
> +#if !defined(CONFIG_ZONE_DEVICE) && !defined(CONFIG_NUMA)
> static inline struct zone *device_zone(int nid)
> {
> 	return NULL;
> _
> 



      reply	other threads:[~2026-09-10  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 21:56 [akpm-mm:mm-new] BUILD REGRESSION 0bffe67ab8a72b3725cc31c4b525709bd3a3e223 kernel test robot
2026-09-09 22:36 ` Andrew Morton
2026-09-10  2:43   ` Muchun Song [this message]

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=AA5FC896-AC1B-4112-BA14-E1F8865358BF@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=songmuchun@bytedance.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox