Re: [PATCH v2] libnvdimm, e820: fix numa node for e820-type-12 pmem ranges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
> Reported-by: Boaz Harrosh <boaz@xxxxxxxxxxxxx>
> Tested-by: Boaz Harrosh <boaz@xxxxxxxxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> ---
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux