diff mbox series

[06/37] xen/arm: use !CONFIG_NUMA to keep fake NUMA API

Message ID 20210923120236.3692135-7-wei.chen@arm.com (mailing list archive)
State New, archived
Headers show
Series Add device tree based NUMA support to Arm | expand

Commit Message

Wei Chen Sept. 23, 2021, 12:02 p.m. UTC
We have introduced CONFIG_NUMA in previous patch. And this
option is enabled only on x86 in current stage. In a follow
up patch, we will enable this option for Arm. But we still
want users can disable the CONFIG_NUMA through Kconfig. In
this case, keep current fake NUMA API, will make Arm code
still can work with NUMA aware memory allocation and scheduler.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
 xen/include/asm-arm/numa.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Stabellini Sept. 24, 2021, 12:05 a.m. UTC | #1
On Thu, 23 Sep 2021, Wei Chen wrote:
> We have introduced CONFIG_NUMA in previous patch. And this
                                   ^ a

> option is enabled only on x86 in current stage. In a follow
                                ^ at the

> up patch, we will enable this option for Arm. But we still
> want users can disable the CONFIG_NUMA through Kconfig. In
             ^ to be able to disable CONFIG_NUMA via Kconfig.


> this case, keep current fake NUMA API, will make Arm code
                 ^ the

> still can work with NUMA aware memory allocation and scheduler.
        ^ able to work

> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>

With the small grammar fixes:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  xen/include/asm-arm/numa.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> index 9d5739542d..8f1c67e3eb 100644
> --- a/xen/include/asm-arm/numa.h
> +++ b/xen/include/asm-arm/numa.h
> @@ -5,6 +5,8 @@
>  
>  typedef u8 nodeid_t;
>  
> +#ifndef CONFIG_NUMA
> +
>  /* Fake one node for now. See also node_online_map. */
>  #define cpu_to_node(cpu) 0
>  #define node_to_cpumask(node)   (cpu_online_map)
> @@ -25,6 +27,8 @@ extern mfn_t first_valid_mfn;
>  #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
>  #define __node_distance(a, b) (20)
>  
> +#endif
> +
>  static inline unsigned int arch_have_default_dmazone(void)
>  {
>      return 0;
> -- 
> 2.25.1
>
Wei Chen Sept. 24, 2021, 10:21 a.m. UTC | #2
> -----Original Message-----
> From: Stefano Stabellini <sstabellini@kernel.org>
> Sent: 2021年9月24日 8:05
> To: Wei Chen <Wei.Chen@arm.com>
> Cc: xen-devel@lists.xenproject.org; sstabellini@kernel.org; julien@xen.org;
> Bertrand Marquis <Bertrand.Marquis@arm.com>
> Subject: Re: [PATCH 06/37] xen/arm: use !CONFIG_NUMA to keep fake NUMA API
> 
> On Thu, 23 Sep 2021, Wei Chen wrote:
> > We have introduced CONFIG_NUMA in previous patch. And this
>                                    ^ a
> 
> > option is enabled only on x86 in current stage. In a follow
>                                 ^ at the
> 
> > up patch, we will enable this option for Arm. But we still
> > want users can disable the CONFIG_NUMA through Kconfig. In
>              ^ to be able to disable CONFIG_NUMA via Kconfig.
> 
> 
> > this case, keep current fake NUMA API, will make Arm code
>                  ^ the
> 
> > still can work with NUMA aware memory allocation and scheduler.
>         ^ able to work
> 
> >
> > Signed-off-by: Wei Chen <wei.chen@arm.com>
> 
> With the small grammar fixes:
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 

Thanks, I will fix them in next version.

> > ---
> >  xen/include/asm-arm/numa.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> > index 9d5739542d..8f1c67e3eb 100644
> > --- a/xen/include/asm-arm/numa.h
> > +++ b/xen/include/asm-arm/numa.h
> > @@ -5,6 +5,8 @@
> >
> >  typedef u8 nodeid_t;
> >
> > +#ifndef CONFIG_NUMA
> > +
> >  /* Fake one node for now. See also node_online_map. */
> >  #define cpu_to_node(cpu) 0
> >  #define node_to_cpumask(node)   (cpu_online_map)
> > @@ -25,6 +27,8 @@ extern mfn_t first_valid_mfn;
> >  #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
> >  #define __node_distance(a, b) (20)
> >
> > +#endif
> > +
> >  static inline unsigned int arch_have_default_dmazone(void)
> >  {
> >      return 0;
> > --
> > 2.25.1
> >
diff mbox series

Patch

diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index 9d5739542d..8f1c67e3eb 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -5,6 +5,8 @@ 
 
 typedef u8 nodeid_t;
 
+#ifndef CONFIG_NUMA
+
 /* Fake one node for now. See also node_online_map. */
 #define cpu_to_node(cpu) 0
 #define node_to_cpumask(node)   (cpu_online_map)
@@ -25,6 +27,8 @@  extern mfn_t first_valid_mfn;
 #define node_start_pfn(nid) (mfn_x(first_valid_mfn))
 #define __node_distance(a, b) (20)
 
+#endif
+
 static inline unsigned int arch_have_default_dmazone(void)
 {
     return 0;