From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v2] libnvdimm, e820: fix numa node for e820-type-12 pmem ranges Date: Fri, 13 Nov 2015 09:00:40 -0800 Message-ID: References: <20151112175215.2462.69420.stgit@dwillia2-desk3.jf.intel.com> <1447433307.21443.90.camel@hpe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "linux-nvdimm@lists.01.org" , linux-fsdevel , "stable@vger.kernel.org" To: Toshi Kani Return-path: Received: from mail-wm0-f44.google.com ([74.125.82.44]:34801 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932997AbbKMRAm (ORCPT ); Fri, 13 Nov 2015 12:00:42 -0500 Received: by wmvv187 with SMTP id v187so90961587wmv.1 for ; Fri, 13 Nov 2015 09:00:41 -0800 (PST) In-Reply-To: <1447433307.21443.90.camel@hpe.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Nov 13, 2015 at 8:48 AM, Toshi Kani wrote: > 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) > { > I thought so too, but 0day reported this: https://lists.01.org/pipermail/kbuild-all/2015-November/014618.html