From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D719C4363A for ; Fri, 30 Oct 2020 11:34:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 502932076E for ; Fri, 30 Oct 2020 11:34:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FShVL5L/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 502932076E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3CA8D6B005C; Fri, 30 Oct 2020 07:34:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 37DB86B005D; Fri, 30 Oct 2020 07:34:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2924C6B0062; Fri, 30 Oct 2020 07:34:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id F11026B005C for ; Fri, 30 Oct 2020 07:34:37 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8865C181AC9B6 for ; Fri, 30 Oct 2020 11:34:37 +0000 (UTC) X-FDA: 77428384194.24.soda80_1a08df827295 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 6F7A61A4A0 for ; Fri, 30 Oct 2020 11:34:37 +0000 (UTC) X-HE-Tag: soda80_1a08df827295 X-Filterd-Recvd-Size: 6065 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 11:34:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604057676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YZZiFHkCJ4oPedcp68fkUsKmumK9JIlBRCeMmx6sJP4=; b=FShVL5L/eHZ+4sPOJQ4TamBr0fKTfvzWgsBihTV8QFWaseeO9x1hWZ+TYpmXu+49U0AeHG ZUoP5Rv/qipwQhEaxMatgE938Fuqtgyo77bzeswwJPTbYgTqVqLxJaextxvQbdj3Zk/8Vg th3+m+pe4D10XlA1dwO/OpU2jeAFfZY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-EEeP5EFhOW2VXK5Rky8MpA-1; Fri, 30 Oct 2020 07:34:32 -0400 X-MC-Unique: EEeP5EFhOW2VXK5Rky8MpA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67EDD107B784; Fri, 30 Oct 2020 11:34:30 +0000 (UTC) Received: from [10.36.112.97] (ovpn-112-97.ams2.redhat.com [10.36.112.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5420160F96; Fri, 30 Oct 2020 11:34:27 +0000 (UTC) Subject: Re: [PATCH] x86/mm: Fix phys_to_target_node() export To: Dan Williams , akpm@linux-foundation.org Cc: Randy Dunlap , Thomas Gleixner , kernel test robot , Joao Martins , x86@kernel.org, Vishal Verma , linux-mm@kvack.org, linux-nvdimm@lists.01.org References: <160402498564.4173389.2743697400148832021.stgit@dwillia2-desk3.amr.corp.intel.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <708658b8-fc77-1503-5c98-c05b50c92b90@redhat.com> Date: Fri, 30 Oct 2020 12:34:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <160402498564.4173389.2743697400148832021.stgit@dwillia2-desk3.amr.corp.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 30.10.20 03:29, Dan Williams wrote: > The core-mm has a default __weak implementation of phys_to_target_node() > when the architecture does not override it. That symbol is exported > for modules. However, while the export in mm/memory_hotplug.c exported > the symbol in the configuration cases of: > > CONFIG_NUMA_KEEP_MEMINFO=y > CONFIG_MEMORY_HOTPLUG=y > > ...and: > > CONFIG_NUMA_KEEP_MEMINFO=n > CONFIG_MEMORY_HOTPLUG=y > > ...it failed to export the symbol in the case of: > > CONFIG_NUMA_KEEP_MEMINFO=y > CONFIG_MEMORY_HOTPLUG=n > > Always export the symbol from the CONFIG_NUMA_KEEP_MEMINFO section of > arch/x86/mm/numa.c, and teach mm/memory_hotplug.c to optionally export > in case arch/x86/mm/numa.c has already performed the export. > > The dependency on NUMA_KEEP_MEMINFO for DEV_DAX_HMEM_DEVICES is invalid > now that the symbol is properly exported in all combinations of > CONFIG_NUMA_KEEP_MEMINFO and CONFIG_MEMORY_HOTPLUG. Note that in the > CONFIG_NUMA=n case no export is needed since their is a dummy static > inline implementation of phys_to_target_node() in that case. > > Reported-by: Randy Dunlap > Reported-by: Thomas Gleixner > Reported-by: kernel test robot > Fixes: a035b6bf863e ("mm/memory_hotplug: introduce default phys_to_target_node() implementation") > Cc: Joao Martins > Cc: Andrew Morton > Cc: x86@kernel.org > Cc: Vishal Verma > Signed-off-by: Dan Williams > --- > arch/x86/mm/numa.c | 1 + > drivers/dax/Kconfig | 1 - > mm/memory_hotplug.c | 5 +++++ > 3 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > index 44148691d78b..e025947f19e0 100644 > --- a/arch/x86/mm/numa.c > +++ b/arch/x86/mm/numa.c > @@ -938,6 +938,7 @@ int phys_to_target_node(phys_addr_t start) > > return meminfo_to_nid(&numa_reserved_meminfo, start); > } > +EXPORT_SYMBOL_GPL(phys_to_target_node); > > int memory_add_physaddr_to_nid(u64 start) > { > diff --git a/drivers/dax/Kconfig b/drivers/dax/Kconfig > index 567428e10b7b..d2834c2cfa10 100644 > --- a/drivers/dax/Kconfig > +++ b/drivers/dax/Kconfig > @@ -50,7 +50,6 @@ config DEV_DAX_HMEM > Say M if unsure. > > config DEV_DAX_HMEM_DEVICES > - depends on NUMA_KEEP_MEMINFO # for phys_to_target_node() > depends on DEV_DAX_HMEM && DAX=y > def_bool y > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index b44d4c7ba73b..ed326b489674 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -365,9 +365,14 @@ int __weak phys_to_target_node(u64 start) > start); > return 0; > } > + > +/* If the arch did not export a strong symbol, export the weak one. */ > +#ifndef CONFIG_NUMA_KEEP_MEMINFO > EXPORT_SYMBOL_GPL(phys_to_target_node); > #endif > > +#endif > + > /* find the smallest valid pfn in the range [start_pfn, end_pfn) */ > static unsigned long find_smallest_section_pfn(int nid, struct zone *zone, > unsigned long start_pfn, > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb