linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented
@ 2013-01-14 10:53 Lin Feng
  2013-01-14 18:43 ` Michal Hocko
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Feng @ 2013-01-14 10:53 UTC (permalink / raw)
  To: akpm, mhocko, linux-mm
  Cc: wency, jiang.liu, laijs, isimatu.yasuaki, linux-kernel, tangchen,
	linfeng

Memory-hotplug codes for x86_64 have been implemented by patchset:
https://lkml.org/lkml/2013/1/9/124
While other platforms haven't been completely implemented yet.

If we enable both CONFIG_MEMORY_HOTPLUG_SPARSE and CONFIG_SPARSEMEM_VMEMMAP,
register_page_bootmem_info_node() may be buggy, which is a hotplug generic
function but falling back to call platform related function
register_page_bootmem_memmap().

Other platforms such as powerpc it's not implemented, so on such platforms,
revert them as empty as they were before.

Reported-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Lin Feng <linfeng@cn.fujitsu.com>
---
 mm/memory_hotplug.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 8aa2b56..bd93c2e 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -189,6 +189,7 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
 }
 #endif
 
+#ifdef CONFIG_X86_64
 void register_page_bootmem_info_node(struct pglist_data *pgdat)
 {
 	unsigned long i, pfn, end_pfn, nr_pages;
@@ -230,6 +231,14 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
 			register_page_bootmem_info_section(pfn);
 	}
 }
+#else
+static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
+{
+	/*
+	 * Todo: platforms other than X86_64 haven't been implemented yet.
+	 */
+}
+#endif
 
 static void grow_zone_span(struct zone *zone, unsigned long start_pfn,
 			   unsigned long end_pfn)
-- 
1.7.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented
  2013-01-14 10:53 [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented Lin Feng
@ 2013-01-14 18:43 ` Michal Hocko
  2013-01-15 10:27   ` Lin Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Hocko @ 2013-01-14 18:43 UTC (permalink / raw)
  To: Lin Feng
  Cc: akpm, linux-mm, wency, jiang.liu, laijs, isimatu.yasuaki,
	linux-kernel, tangchen

On Mon 14-01-13 18:53:55, Lin Feng wrote:
> Memory-hotplug codes for x86_64 have been implemented by patchset:
> https://lkml.org/lkml/2013/1/9/124
> While other platforms haven't been completely implemented yet.
> 
> If we enable both CONFIG_MEMORY_HOTPLUG_SPARSE and CONFIG_SPARSEMEM_VMEMMAP,
> register_page_bootmem_info_node() may be buggy, which is a hotplug generic
> function but falling back to call platform related function
> register_page_bootmem_memmap().
> 
> Other platforms such as powerpc it's not implemented, so on such platforms,
> revert them as empty as they were before.
> 
> Reported-by: Michal Hocko <mhocko@suse.cz>
> Signed-off-by: Lin Feng <linfeng@cn.fujitsu.com>
> ---
>  mm/memory_hotplug.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 8aa2b56..bd93c2e 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -189,6 +189,7 @@ static void register_page_bootmem_info_section(unsigned long start_pfn)
>  }
>  #endif
>  
> +#ifdef CONFIG_X86_64
>  void register_page_bootmem_info_node(struct pglist_data *pgdat)
>  {
>  	unsigned long i, pfn, end_pfn, nr_pages;
> @@ -230,6 +231,14 @@ void register_page_bootmem_info_node(struct pglist_data *pgdat)
>  			register_page_bootmem_info_section(pfn);
>  	}
>  }
> +#else
> +static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
> +{
> +	/*
> +	 * Todo: platforms other than X86_64 haven't been implemented yet.
> +	 */
> +}
> +#endif

This is just ugly. Could you please add something like HAVE_BOOTMEM_INFO_NODE
or something with a bettern name and let CONFIG_MEMORY_HOTPLUG select it
for supported architectures and configurations (e.g.
CONFIG_SPARSEMEM_VMEMMAP doesn't need a special arch support, right?).
These Todo things are just too messy.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented
  2013-01-14 18:43 ` Michal Hocko
@ 2013-01-15 10:27   ` Lin Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Lin Feng @ 2013-01-15 10:27 UTC (permalink / raw)
  To: Michal Hocko
  Cc: akpm, linux-mm, wency, jiang.liu, laijs, isimatu.yasuaki,
	linux-kernel, tangchen

Hi Michal,

I have updated to V2 version according to what you said, would you please take a look 
if it conforms to what you think? 

thanks,
linfeng

On 01/15/2013 02:43 AM, Michal Hocko wrote:
> This is just ugly. Could you please add something like HAVE_BOOTMEM_INFO_NODE
> or something with a bettern name and let CONFIG_MEMORY_HOTPLUG select it
> for supported architectures and configurations (e.g.
> CONFIG_SPARSEMEM_VMEMMAP doesn't need a special arch support, right?).
> These Todo things are just too messy.
> -- 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-01-15 10:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 10:53 [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented Lin Feng
2013-01-14 18:43 ` Michal Hocko
2013-01-15 10:27   ` Lin Feng

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