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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 D41F0C4741F for ; Sat, 31 Oct 2020 09:10:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6563920791 for ; Sat, 31 Oct 2020 09:10:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TsLV0qIe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6563920791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B1B666B0036; Sat, 31 Oct 2020 05:10:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACB206B005C; Sat, 31 Oct 2020 05:10:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B9DD6B005D; Sat, 31 Oct 2020 05:10:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 6E5246B0036 for ; Sat, 31 Oct 2020 05:10:29 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0ADD48249980 for ; Sat, 31 Oct 2020 09:10:29 +0000 (UTC) X-FDA: 77431649778.25.price18_04134212729d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id DB16D1804E3A0 for ; Sat, 31 Oct 2020 09:10:28 +0000 (UTC) X-HE-Tag: price18_04134212729d X-Filterd-Recvd-Size: 2972 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Sat, 31 Oct 2020 09:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oPEIdviMxitzL+S1gMzK4Ov2/vXRQ0CoB5foU9ASBJI=; b=TsLV0qIeRD7+WPLBsTtpeiXcC2 jrIyXcEejkSHMIGI8nJCJRTopjHXb750mavvwffuq+2acbkDNzOI3LciYC4Qra2/TjS0NGEyFdhP6 +c4dSHl9ustxjNP4YxcmIqjODenVNwRdm49PsHLFyR8aqEGXLecNXlp93mjsfEI5yBuAF956QGHkT unDaIKhDayBEeANzWX6J0Gr5RCsZAGb6d7DVWcMTT2mvh1rsSp/sQ84Mu61CVM1xfp5lFu2A2pvIU BvMp1haBWtYUkXDVB9BAha59F+IfIg0TEjPTzxsrsaAd3rViQpuznsu7bIlpb2XcC1nW86wxTE8Qv DJ1Vaz4A==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYmto-0007Vn-Jp; Sat, 31 Oct 2020 09:10:12 +0000 Date: Sat, 31 Oct 2020 09:10:12 +0000 From: Christoph Hellwig To: Dan Williams Cc: akpm@linux-foundation.org, Randy Dunlap , Thomas Gleixner , kernel test robot , Joao Martins , x86@kernel.org, linux-mm@kvack.org, linux-nvdimm@lists.01.org Subject: Re: [PATCH] x86/mm: Fix phys_to_target_node() export Message-ID: <20201031091012.GA27844@infradead.org> References: <160402498564.4173389.2743697400148832021.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <160402498564.4173389.2743697400148832021.stgit@dwillia2-desk3.amr.corp.intel.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html 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 Thu, Oct 29, 2020 at 07:29:45PM -0700, 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: Which just means that we should never export weak symbols. So instead of hacking around this introduce a symbol that indicates that the architecture impements phys_to_target_node, and don't defined it at all in common code for that case. > --- 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 i.e. move the ifdef to include the actual phys_to_target_node definition, and remove the __weak from it here.