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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 D007DC433E1 for ; Tue, 7 Jul 2020 22:06:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B21220720 for ; Tue, 7 Jul 2020 22:06:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="H+n+9TP7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B21220720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F2FDA6B009B; Tue, 7 Jul 2020 18:06:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE1EB6B00A1; Tue, 7 Jul 2020 18:06:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA8716B00A3; Tue, 7 Jul 2020 18:06:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id C3FB46B009B for ; Tue, 7 Jul 2020 18:06:05 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 49FF7181AEF00 for ; Tue, 7 Jul 2020 22:06:05 +0000 (UTC) X-FDA: 77012663490.16.match90_5f1154526eb7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 81EC6100E6912 for ; Tue, 7 Jul 2020 22:06:04 +0000 (UTC) X-HE-Tag: match90_5f1154526eb7 X-Filterd-Recvd-Size: 5970 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 22:06:03 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id rk21so48337690ejb.2 for ; Tue, 07 Jul 2020 15:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9ZNdEvOeP3WuasriJp99yNmKAqGYs/GDNRQigz82k5M=; b=H+n+9TP7Ync3pQ943fEua/W14EUsU6cicDP7/YLJ/PRvM+mZjYM8zcWL39+gexyw2V FYSk06t7fNJmZ7TAJ4Np01W5P1ft/pW/2VJ86staRo4F0UxvW1RVoJsVKMje5ZQPFrrS DFbfikXXkva+7/BFNQeoi9OPJ24mrF56i1SSrkTTH0SEekL/cUi8xID9xXwTRNSZ7YCX zn/UKP8JGJegSSE1H2tUhQI9FIZFmp4TLPJmWGQ4U8tZr1i6dSOqD5P6owjw9XJVKd7T jlPTIIXDpImb2q/1BlQID8aF78voE5pAskTFgCkqeFf+tOMh+B2lAG0WbP88eif7jpLo Ra7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZNdEvOeP3WuasriJp99yNmKAqGYs/GDNRQigz82k5M=; b=GKK8+C4egeXnenhYns2yR8YuqLOoejkQL3Is8u/HQSOC4H5g7HbbVtEe+pk7c9/hSv ttS0C0CdwPd5cuxhzvft4dCteW6CBQjDliRm+oWGqqk6Bdy4vgzxPffhl6jFCUGUt2Kx 1k247fbShEsSufvyzwLvgqF2sdT4Ukiuax07XnaveZUhECr2ayd682phCH6yfNLS/v2b InEnLjekTAWL8kz4ZZzL9O4t/bOTqtR31WZMc8QZmTWwL19dBgsY2XKUwMgiLZmtGcjj GkuBCr6Tbgoz8EB1w1YMp7lg0zCZcvZkfW4EhFr57OCEmBZsQTlFyJIuZw1oiA9C4FZB v8ag== X-Gm-Message-State: AOAM533Zl+CGmRlYlhMxxtwgMA52oXXXGUhmIXFvw/wNwLwWfkml3JMH UHgauvZhzbfR47rHDMxtDsWTJq4Kj9A/vmMF4j9o/Q== X-Google-Smtp-Source: ABdhPJzxamlNKlD2fbS8kUI/eRgH4V8jHgv25Sc3W50tBjzP0xq+Ps6l4+gy8ejY3ioNAlrVUymfpv+0QpgeJdPW3+I= X-Received: by 2002:a17:906:1a54:: with SMTP id j20mr48420370ejf.455.1594159562129; Tue, 07 Jul 2020 15:06:02 -0700 (PDT) MIME-Version: 1.0 References: <20200707055917.143653-1-justin.he@arm.com> <20200707055917.143653-2-justin.he@arm.com> <20200707115454.GN5913@dhcp22.suse.cz> <20200707121302.GB9411@linux.ibm.com> <474f93e7-c709-1a13-5418-29f1777f614c@redhat.com> <20200707180043.GA386073@linux.ibm.com> In-Reply-To: <20200707180043.GA386073@linux.ibm.com> From: Dan Williams Date: Tue, 7 Jul 2020 15:05:48 -0700 Message-ID: Subject: Re: [PATCH v2 1/3] arm64/numa: export memory_add_physaddr_to_nid as EXPORT_SYMBOL_GPL To: Mike Rapoport Cc: David Hildenbrand , Michal Hocko , Jia He , Catalin Marinas , Will Deacon , Vishal Verma , Dave Jiang , Andrew Morton , Baoquan He , Chuhong Yuan , Linux ARM , Linux Kernel Mailing List , Linux MM , linux-nvdimm , Kaly Xin Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 81EC6100E6912 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Tue, Jul 7, 2020 at 11:01 AM Mike Rapoport wrote: > > On Tue, Jul 07, 2020 at 02:26:08PM +0200, David Hildenbrand wrote: > > On 07.07.20 14:13, Mike Rapoport wrote: > > > On Tue, Jul 07, 2020 at 01:54:54PM +0200, Michal Hocko wrote: > > >> On Tue 07-07-20 13:59:15, Jia He wrote: > > >>> This exports memory_add_physaddr_to_nid() for module driver to use. > > >>> > > >>> memory_add_physaddr_to_nid() is a fallback option to get the nid in case > > >>> NUMA_NO_NID is detected. > > >>> > > >>> Suggested-by: David Hildenbrand > > >>> Signed-off-by: Jia He > > >>> --- > > >>> arch/arm64/mm/numa.c | 5 +++-- > > >>> 1 file changed, 3 insertions(+), 2 deletions(-) > > >>> > > >>> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c > > >>> index aafcee3e3f7e..7eeb31740248 100644 > > >>> --- a/arch/arm64/mm/numa.c > > >>> +++ b/arch/arm64/mm/numa.c > > >>> @@ -464,10 +464,11 @@ void __init arm64_numa_init(void) > > >>> > > >>> /* > > >>> * We hope that we will be hotplugging memory on nodes we already know about, > > >>> - * such that acpi_get_node() succeeds and we never fall back to this... > > >>> + * such that acpi_get_node() succeeds. But when SRAT is not present, the node > > >>> + * id may be probed as NUMA_NO_NODE by acpi, Here provide a fallback option. > > >>> */ > > >>> int memory_add_physaddr_to_nid(u64 addr) > > >>> { > > >>> - pr_warn("Unknown node for memory at 0x%llx, assuming node 0\n", addr); > > >>> return 0; > > >>> } > > >>> +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); > > >> > > >> Does it make sense to export a noop function? Wouldn't make more sense > > >> to simply make it static inline somewhere in a header? I haven't checked > > >> whether there is an easy way to do that sanely bu this just hit my eyes. > > > > > > We'll need to either add a CONFIG_ option or arch specific callback to > > > make both non-empty (x86, powerpc, ia64) and empty (arm64, sh) > > > implementations coexist ... > > > > Note: I have a similar dummy (return 0) patch for s390x lying around here. > > Then we'll call it a tie - 3:3 ;-) So I'd be happy to jump on the train of people wanting to export the ARM stub for this (and add a new ARM stub for phys_to_target_node()), but Will did have a plausibly better idea that I have been meaning to circle back to: http://lore.kernel.org/r/20200325111039.GA32109@willie-the-truck ...i.e. iterate over node data to do the lookup. This would seem to work generically for multiple archs unless I am missing something?