linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toshi Kani <toshi.kani@hpe.com>
To: Dan Williams <dan.j.williams@intel.com>, linux-nvdimm@lists.01.org
Cc: linux-fsdevel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] libnvdimm, e820: fix numa node for e820-type-12 pmem ranges
Date: Fri, 13 Nov 2015 09:48:27 -0700	[thread overview]
Message-ID: <1447433307.21443.90.camel@hpe.com> (raw)
In-Reply-To: <20151112175215.2462.69420.stgit@dwillia2-desk3.jf.intel.com>

On Thu, 2015-11-12 at 09:53 -0800, Dan Williams wrote:
> Rather than punt on the numa node for these e820 ranges try to find a
> better answer with memory_add_physaddr_to_nid() when it is available.
> 
> Cc: <stable@vger.kernel.org>
> Reported-by: Boaz Harrosh <boaz@plexistor.com>
> Tested-by: Boaz Harrosh <boaz@plexistor.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> Only change from the original version is a compile fix for the
> CONFIG_MEMORY_HOTPLUG=n case.
> 
>  drivers/nvdimm/e820.c |   15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvdimm/e820.c b/drivers/nvdimm/e820.c
> index 8282db2ef99e..b0045a505dc8 100644
> --- a/drivers/nvdimm/e820.c
> +++ b/drivers/nvdimm/e820.c
> @@ -3,6 +3,7 @@
>   * Copyright (c) 2015, Intel Corporation.
>   */
>  #include <linux/platform_device.h>
> +#include <linux/memory_hotplug.h>
>  #include <linux/libnvdimm.h>
>  #include <linux/module.h>
>  
> @@ -25,6 +26,18 @@ static int e820_pmem_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_MEMORY_HOTPLUG
> +static int e820_range_to_nid(resource_size_t addr)
> +{
> +	return memory_add_physaddr_to_nid(addr);
> +}
> +#else
> +static int e820_range_to_nid(resource_size_t addr)
> +{
> +	return NUMA_NO_NODE;
> +}
> +#endif

"linux/memory_hotplug.h" defines as follows.

#ifdef CONFIG_NUMA
extern int memory_add_physaddr_to_nid(u64 start);
#else
static inline int memory_add_physaddr_to_nid(u64 start)
{
        return 0;
}
#endif

So, memory_add_physaddr_to_nid() should be defined with #ifdef CONFIG_NUMA.

#ifdef CONFIG_MEMORY_HOTPLUG
int memory_add_physaddr_to_nid(u64 start)
{


Thanks,
-Toshi

  reply	other threads:[~2015-11-13 16:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 17:53 [PATCH v2] libnvdimm, e820: fix numa node for e820-type-12 pmem ranges Dan Williams
2015-11-13 16:48 ` Toshi Kani [this message]
2015-11-13 17:00   ` Dan Williams
2015-11-13 17:42     ` Toshi Kani

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=1447433307.21443.90.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).