From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toshi Kani Subject: Re: [PATCH v2] libnvdimm, e820: fix numa node for e820-type-12 pmem ranges Date: Fri, 13 Nov 2015 09:48:27 -0700 Message-ID: <1447433307.21443.90.camel@hpe.com> References: <20151112175215.2462.69420.stgit@dwillia2-desk3.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, stable@vger.kernel.org To: Dan Williams , linux-nvdimm@lists.01.org Return-path: In-Reply-To: <20151112175215.2462.69420.stgit@dwillia2-desk3.jf.intel.com> Sender: stable-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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: > Reported-by: Boaz Harrosh > Tested-by: Boaz Harrosh > Signed-off-by: Dan Williams > --- > 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 > +#include > #include > #include > > @@ -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