lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z_anHMHgQQM3y-w2@localhost.localdomain>
Date: Wed, 9 Apr 2025 18:58:04 +0200
From: Oscar Salvador <osalvador@...e.de>
To: kernel test robot <lkp@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, llvm@...ts.linux.dev,
	oe-kbuild-all@...ts.linux.dev,
	Linux Memory Management List <linux-mm@...ck.org>,
	David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
	Vlastimil Babka <vbabka@...e.cz>, Harry Yoo <harry.yoo@...cle.com>,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>,
	linux-cxl@...r.kernel.org
Subject: Re: [PATCH v2 2/3] mm,memory_hotplug: Implement numa node notifier

On Wed, Apr 09, 2025 at 09:44:52PM +0800, kernel test robot wrote:
> Hi Oscar,
> 
> kernel test robot noticed the following build errors:
... 
> >> drivers/base/node.c:115:5: error: redefinition of 'register_node_notifier'
>      115 | int register_node_notifier(struct notifier_block *nb)
>          |     ^
>    include/linux/memory.h:172:19: note: previous definition is here
>      172 | static inline int register_node_notifier(struct notifier_block *nb)
>          |                   ^
> >> drivers/base/node.c:121:6: error: redefinition of 'unregister_node_notifier'
>      121 | void unregister_node_notifier(struct notifier_block *nb)
>          |      ^
>    include/linux/memory.h:176:20: note: previous definition is here
>      176 | static inline void unregister_node_notifier(struct notifier_block *nb)
>          |                    ^
> >> drivers/base/node.c:127:5: error: redefinition of 'node_notify'
>      127 | int node_notify(unsigned long val, void *v)
>          |     ^
>    include/linux/memory.h:179:19: note: previous definition is here
>      179 | static inline int node_notify(unsigned long val, void *v)
>          |                   ^
>    3 errors generated.

Ah, I see. When CONFIG_MEMORY_HOTPLUG=n those come into play.
That is not a problem for the memory-notify thing because drivers/base/memory.c
gets compiled IFF CONFIG_MEMORY_HOTPLUG=y.
I am thinking two ways to fix this:

 1) Move the code for node-notify to drivers/base/memory.c
 2) Surround those functions within a
 #ifdef CONFIG_MEMORY_HOTPLUG
 ...
 #endif

Thoughts? I lean towards option #2 as it looks cleaner to me:

 diff --git a/drivers/base/node.c b/drivers/base/node.c
 index 182c71dfb5b8..3b084d71888a 100644
 --- a/drivers/base/node.c
 +++ b/drivers/base/node.c
 @@ -110,6 +110,7 @@ static const struct attribute_group *node_access_node_groups[] = {
         NULL,
  };
  
 +#ifdef CONFIG_MEMORY_HOTPLUG
  static BLOCKING_NOTIFIER_HEAD(node_chain);
  
  int register_node_notifier(struct notifier_block *nb)
 @@ -128,6 +129,7 @@ int node_notify(unsigned long val, void *v)
  {
         return blocking_notifier_call_chain(&node_chain, val, v);
  }
 +#endif
  
  static void node_remove_accesses(struct node *node)
  {



-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ