Re: [PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA

2020-02-13 Thread Dan Williams
On Thu, Feb 13, 2020 at 3:22 AM Thomas Gleixner  wrote:
>
> Dan Williams  writes:
> > +#ifdef CONFIG_KEEP_NUMA
> > +#define __initdata_numa
> > +#else
> > +#define __initdata_numa __initdata
> > +#endif
>
> TBH, I find this conditional annotation mightingly confusing.
>
> __initdata_numa still suggest that this is __initdata, just a different
> section and some extra rules or whatever.
>
> Something like __initdata_or_keepnuma (sorry I could not come up with
> something prettier, but you get the idea.

Yes, and to dovetail with Ingo's feedback I think
__initdata_or_meminfo conveys it's optionally init vs runtime data.
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


Re: [PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA

2020-02-13 Thread Dan Williams
On Thu, Feb 13, 2020 at 1:32 AM Ingo Molnar  wrote:
>
>
> * Dan Williams  wrote:
>
> > Currently x86 numa_meminfo is marked __initdata in the
> > CONFIG_MEMORY_HOTPLUG=n case. In support of a new facility to allow
> > drivers to map reserved memory to a 'target_node'
> > (phys_to_target_node()), add support for removing the __initdata
> > designation for those users. Both memory hotplug and
> > phys_to_target_node() users select CONFIG_KEEP_NUMA to tell the arch to
> > maintain its physical address to numa mapping infrastructure post init.
> >
> > Cc: Dave Hansen 
> > Cc: Andy Lutomirski 
> > Cc: Peter Zijlstra 
> > Cc: Thomas Gleixner 
> > Cc: Ingo Molnar 
> > Cc: Borislav Petkov 
> > Cc: "H. Peter Anvin" 
> > Cc: 
> > Cc: Andrew Morton 
> > Cc: David Hildenbrand 
> > Cc: Michal Hocko 
> > Signed-off-by: Dan Williams 
> > ---
> >  arch/x86/mm/numa.c   |6 +-
> >  include/linux/numa.h |6 ++
> >  mm/Kconfig   |5 +
> >  3 files changed, 12 insertions(+), 5 deletions(-)
>
> The concept and the x86 portions look sane, just a few minor nits:
>
> >
> > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> > index 99f7a68738f0..5289d9d6799a 100644
> > --- a/arch/x86/mm/numa.c
> > +++ b/arch/x86/mm/numa.c
> > @@ -25,11 +25,7 @@ nodemask_t numa_nodes_parsed __initdata;
> >  struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
> >  EXPORT_SYMBOL(node_data);
> >
> > -static struct numa_meminfo numa_meminfo
> > -#ifndef CONFIG_MEMORY_HOTPLUG
> > -__initdata
> > -#endif
> > -;
> > +static struct numa_meminfo numa_meminfo __initdata_numa;
> >
> >  static int numa_distance_cnt;
> >  static u8 *numa_distance;
> > diff --git a/include/linux/numa.h b/include/linux/numa.h
> > index 20f4e44b186c..c005ed6b807b 100644
> > --- a/include/linux/numa.h
> > +++ b/include/linux/numa.h
> > @@ -13,6 +13,12 @@
> >
> >  #define  NUMA_NO_NODE(-1)
> >
> > +#ifdef CONFIG_KEEP_NUMA
> > +#define __initdata_numa
> > +#else
> > +#define __initdata_numa __initdata
> > +#endif
> > +
> >  #ifdef CONFIG_NUMA
> >  int numa_map_to_online_node(int node);
> >  #else
> > diff --git a/mm/Kconfig b/mm/Kconfig
> > index ab80933be65f..001f1185eadf 100644
> > --- a/mm/Kconfig
> > +++ b/mm/Kconfig
> > @@ -139,6 +139,10 @@ config HAVE_FAST_GUP
> >  config ARCH_KEEP_MEMBLOCK
> >   bool
> >
> > +# Keep arch numa mapping infrastructure post-init.
>
> s/numa/NUMA
>
> Please also capitalize consistently in the rest of the series.
>
> > +config KEEP_NUMA
> > + bool
>
>
> So most of our recent new NUMA options followed the naming pattern of:
>
>   CONFIG_NUMA_*
>
> Such as CONFIG_NUMA_BALANCING or CONFIG_NUMA_EMU.
>
> So I'd suggesting naming it to CONFIG_NUMA_KEEP, or, a bit more
> descriptively, such as CONFIG_NUMA_KEEP_MAPPING or such?
>
> 'Keeping NUMA' is kind of lame - of course we keep NUMA. ;-)

Ok, I settled on CONFIG_NUMA_KEEP_MEMINFO, and will fix up the
lowercase "numa" instances in the set.
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


Re: [PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA

2020-02-13 Thread Thomas Gleixner
Dan Williams  writes:
> +#ifdef CONFIG_KEEP_NUMA
> +#define __initdata_numa
> +#else
> +#define __initdata_numa __initdata
> +#endif

TBH, I find this conditional annotation mightingly confusing.

__initdata_numa still suggest that this is __initdata, just a different
section and some extra rules or whatever.

Something like __initdata_or_keepnuma (sorry I could not come up with
something prettier, but you get the idea.

Thanks,

tglx
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


Re: [PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA

2020-02-13 Thread Ingo Molnar


* Dan Williams  wrote:

> Currently x86 numa_meminfo is marked __initdata in the
> CONFIG_MEMORY_HOTPLUG=n case. In support of a new facility to allow
> drivers to map reserved memory to a 'target_node'
> (phys_to_target_node()), add support for removing the __initdata
> designation for those users. Both memory hotplug and
> phys_to_target_node() users select CONFIG_KEEP_NUMA to tell the arch to
> maintain its physical address to numa mapping infrastructure post init.
> 
> Cc: Dave Hansen 
> Cc: Andy Lutomirski 
> Cc: Peter Zijlstra 
> Cc: Thomas Gleixner 
> Cc: Ingo Molnar 
> Cc: Borislav Petkov 
> Cc: "H. Peter Anvin" 
> Cc: 
> Cc: Andrew Morton 
> Cc: David Hildenbrand 
> Cc: Michal Hocko 
> Signed-off-by: Dan Williams 
> ---
>  arch/x86/mm/numa.c   |6 +-
>  include/linux/numa.h |6 ++
>  mm/Kconfig   |5 +
>  3 files changed, 12 insertions(+), 5 deletions(-)

The concept and the x86 portions look sane, just a few minor nits:

> 
> diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
> index 99f7a68738f0..5289d9d6799a 100644
> --- a/arch/x86/mm/numa.c
> +++ b/arch/x86/mm/numa.c
> @@ -25,11 +25,7 @@ nodemask_t numa_nodes_parsed __initdata;
>  struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
>  EXPORT_SYMBOL(node_data);
>  
> -static struct numa_meminfo numa_meminfo
> -#ifndef CONFIG_MEMORY_HOTPLUG
> -__initdata
> -#endif
> -;
> +static struct numa_meminfo numa_meminfo __initdata_numa;
>  
>  static int numa_distance_cnt;
>  static u8 *numa_distance;
> diff --git a/include/linux/numa.h b/include/linux/numa.h
> index 20f4e44b186c..c005ed6b807b 100644
> --- a/include/linux/numa.h
> +++ b/include/linux/numa.h
> @@ -13,6 +13,12 @@
>  
>  #define  NUMA_NO_NODE(-1)
>  
> +#ifdef CONFIG_KEEP_NUMA
> +#define __initdata_numa
> +#else
> +#define __initdata_numa __initdata
> +#endif
> +
>  #ifdef CONFIG_NUMA
>  int numa_map_to_online_node(int node);
>  #else
> diff --git a/mm/Kconfig b/mm/Kconfig
> index ab80933be65f..001f1185eadf 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -139,6 +139,10 @@ config HAVE_FAST_GUP
>  config ARCH_KEEP_MEMBLOCK
>   bool
>  
> +# Keep arch numa mapping infrastructure post-init.

s/numa/NUMA

Please also capitalize consistently in the rest of the series.

> +config KEEP_NUMA
> + bool


So most of our recent new NUMA options followed the naming pattern of:

  CONFIG_NUMA_*

Such as CONFIG_NUMA_BALANCING or CONFIG_NUMA_EMU.

So I'd suggesting naming it to CONFIG_NUMA_KEEP, or, a bit more 
descriptively, such as CONFIG_NUMA_KEEP_MAPPING or such?

'Keeping NUMA' is kind of lame - of course we keep NUMA. ;-)

Thanks,

Ingo
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org


[PATCH v4 4/6] x86/mm: Introduce CONFIG_KEEP_NUMA

2020-01-21 Thread Dan Williams
Currently x86 numa_meminfo is marked __initdata in the
CONFIG_MEMORY_HOTPLUG=n case. In support of a new facility to allow
drivers to map reserved memory to a 'target_node'
(phys_to_target_node()), add support for removing the __initdata
designation for those users. Both memory hotplug and
phys_to_target_node() users select CONFIG_KEEP_NUMA to tell the arch to
maintain its physical address to numa mapping infrastructure post init.

Cc: Dave Hansen 
Cc: Andy Lutomirski 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: Borislav Petkov 
Cc: "H. Peter Anvin" 
Cc: 
Cc: Andrew Morton 
Cc: David Hildenbrand 
Cc: Michal Hocko 
Signed-off-by: Dan Williams 
---
 arch/x86/mm/numa.c   |6 +-
 include/linux/numa.h |6 ++
 mm/Kconfig   |5 +
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 99f7a68738f0..5289d9d6799a 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -25,11 +25,7 @@ nodemask_t numa_nodes_parsed __initdata;
 struct pglist_data *node_data[MAX_NUMNODES] __read_mostly;
 EXPORT_SYMBOL(node_data);
 
-static struct numa_meminfo numa_meminfo
-#ifndef CONFIG_MEMORY_HOTPLUG
-__initdata
-#endif
-;
+static struct numa_meminfo numa_meminfo __initdata_numa;
 
 static int numa_distance_cnt;
 static u8 *numa_distance;
diff --git a/include/linux/numa.h b/include/linux/numa.h
index 20f4e44b186c..c005ed6b807b 100644
--- a/include/linux/numa.h
+++ b/include/linux/numa.h
@@ -13,6 +13,12 @@
 
 #defineNUMA_NO_NODE(-1)
 
+#ifdef CONFIG_KEEP_NUMA
+#define __initdata_numa
+#else
+#define __initdata_numa __initdata
+#endif
+
 #ifdef CONFIG_NUMA
 int numa_map_to_online_node(int node);
 #else
diff --git a/mm/Kconfig b/mm/Kconfig
index ab80933be65f..001f1185eadf 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -139,6 +139,10 @@ config HAVE_FAST_GUP
 config ARCH_KEEP_MEMBLOCK
bool
 
+# Keep arch numa mapping infrastructure post-init.
+config KEEP_NUMA
+   bool
+
 config MEMORY_ISOLATION
bool
 
@@ -154,6 +158,7 @@ config MEMORY_HOTPLUG
bool "Allow for memory hot-add"
depends on SPARSEMEM || X86_64_ACPI_NUMA
depends on ARCH_ENABLE_MEMORY_HOTPLUG
+   select KEEP_NUMA if NUMA
 
 config MEMORY_HOTPLUG_SPARSE
def_bool y
___
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-le...@lists.01.org