All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Lin Feng <linfeng@cn.fujitsu.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	wency@cn.fujitsu.com, jiang.liu@huawei.com, laijs@cn.fujitsu.com,
	isimatu.yasuaki@jp.fujitsu.com, linux-kernel@vger.kernel.org,
	tangchen@cn.fujitsu.com
Subject: Re: [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented
Date: Mon, 14 Jan 2013 19:43:08 +0100	[thread overview]
Message-ID: <20130114184308.GD5126@dhcp22.suse.cz> (raw)
In-Reply-To: <1358160835-30617-1-git-send-email-linfeng@cn.fujitsu.com>

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>

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@suse.cz>
To: Lin Feng <linfeng@cn.fujitsu.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	wency@cn.fujitsu.com, jiang.liu@huawei.com, laijs@cn.fujitsu.com,
	isimatu.yasuaki@jp.fujitsu.com, linux-kernel@vger.kernel.org,
	tangchen@cn.fujitsu.com
Subject: Re: [PATCH] memory-hotplug: revert register_page_bootmem_info_node() to empty when platform related code is not implemented
Date: Mon, 14 Jan 2013 19:43:08 +0100	[thread overview]
Message-ID: <20130114184308.GD5126@dhcp22.suse.cz> (raw)
In-Reply-To: <1358160835-30617-1-git-send-email-linfeng@cn.fujitsu.com>

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

  reply	other threads:[~2013-01-14 18:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 10:53 ` Lin Feng
2013-01-14 18:43 ` Michal Hocko [this message]
2013-01-14 18:43   ` Michal Hocko
2013-01-15 10:27   ` Lin Feng
2013-01-15 10:27     ` Lin Feng

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=20130114184308.GD5126@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=jiang.liu@huawei.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linfeng@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=wency@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.