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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 7BCFFC433E0 for ; Wed, 8 Jul 2020 06:55:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48DEE20760 for ; Wed, 8 Jul 2020 06:55:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3I3BUBb6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="TK82CEOe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48DEE20760 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2TCuJmYcy0l/2DCvyrzM9Lf8N4TtDWwClRi0E7hA0j8=; b=3I3BUBb6gfxnPhNhnYhfPoocg j1j6+mLTekkhBgZG6bb81rx9x2J09zP2/8zXx704B/qR9aXtdp0wHjEpglT9ObhT26W9dVXKkXw0Y EHOxxrnmExUP7RaZWg0weqeRVYX4IABbe5Ne4RtLO4X6P0wSS1VCcKW5aABQmR8J987VeYPTyKZqE /yh6iRhaHGrSOpUYbJezuzV4Y6lgzi1HzwubSO9pOkRZsZ8tGM5jF4EZyXVNq/5w/vVBdH/TtELoM Q3qzaS7nGnNulVbhM7X5z1ctxpxlKV2vA46yOWuam4TXUqBCvLyAN6odSdGtPNQNch1LekvK/rabg mib840raw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jt3xr-0006bg-Ja; Wed, 08 Jul 2020 06:53:55 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jt3xo-0006as-2z for linux-arm-kernel@lists.infradead.org; Wed, 08 Jul 2020 06:53:53 +0000 Received: by mail-ed1-x542.google.com with SMTP id h28so40752304edz.0 for ; Tue, 07 Jul 2020 23:53:51 -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=keyDLeonC8frLPJK5duQJ259ChXYsKspJF9lGM2JwDk=; b=TK82CEOeB8wUtoFdmxlPl9goWXQTwmwz3fiSr8+4rT8AzSHNNgiyKr9SzOXy/lyYf8 gqaMKeXD87fSS3J+6QJP0+LSHMNW0ZGFc9up4RMVAmkS4jbaTwovaSj/bnXzH5YYTWw8 XDbmrRbTJiWIB6TpHSeyaFpbpeKezLxVoHr4En1ZhFpTOC5hVD4ag6e27mzPFkzqDcUx fEwcJ3G7I38S0Hb6/vmtLJwq8ZclIrr/MY4Had/T7LOflv0eZNJVb/E797gXA1c3dP4I Y/LThtVQmuHWyMFoNWoxzJDPdam4biTa84cBlq8Ei4ajOKFco76rSfRzlkdhbIUINB4G kbMQ== 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=keyDLeonC8frLPJK5duQJ259ChXYsKspJF9lGM2JwDk=; b=Y9Ih6cv5FFD3UqlWe99avhwUgqgaFmNAmZp+M8+MI9o5Y8o6nUQd4g4wPfykTGhstb rcbJkm60sVU0VEUYRxEPI/Mac4p+jd2s1f4Agi8BSQCeWaK0a0wkul1BnjAE3KrZTYsu JOu2X5QIz36tqvYnGgLAIcEnlg6GXnn60BoIXzbLu1SvtKh56Cyy21xzHkWNo6toKxVU JGLM8hmd1AJngCQsrBFERt/vh5BY4I346yDjdLDTKODo1+THlaR1qzPRugqzARwws2QP UdNjKuzsNyZvqrKC3SnXVDVaAzu1ZDynqOEV+SeHpKip3/MMoqElABxeuQ0LkAJDJjTd L0hg== X-Gm-Message-State: AOAM531OePBEFmXSWl+9jJ9jq+p8VzrQWSx1ecrcUuSoyd50zf7nfSyE JrOz+kLm96PYCvkdsacsqo/gEY2g5fdr8D3rXx6GsLCIe7A= X-Google-Smtp-Source: ABdhPJzWDULeQmA4RbfXyV27OZ4z7CGs9yHTVKdJ+99n4xIaX6QB9r7/8SCU1NxsX0FBfErjajvE/E1jaCZYv8t+S6M= X-Received: by 2002:a50:d9cb:: with SMTP id x11mr62677191edj.93.1594191230511; Tue, 07 Jul 2020 23:53:50 -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> <20200708062217.GE386073@linux.ibm.com> In-Reply-To: <20200708062217.GE386073@linux.ibm.com> From: Dan Williams Date: Tue, 7 Jul 2020 23:53:39 -0700 Message-ID: Subject: Re: [PATCH v2 1/3] arm64/numa: export memory_add_physaddr_to_nid as EXPORT_SYMBOL_GPL To: Mike Rapoport X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200708_025352_264678_181D8489 X-CRM114-Status: GOOD ( 19.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kaly Xin , Justin He , Baoquan He , David Hildenbrand , Catalin Marinas , "linux-nvdimm@lists.01.org" , Chuhong Yuan , "linux-kernel@vger.kernel.org" , Michal Hocko , "linux-mm@kvack.org" , Vishal Verma , Dave Jiang , Andrew Morton , Will Deacon , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 7, 2020 at 11:22 PM Mike Rapoport wrote: [..] > > > Thanks for your suggestion, > > > Could I wrap the codes and let memory_add_physaddr_to_nid simply invoke > > > phys_to_target_node()? > > > > I think it needs to be the reverse. phys_to_target_node() should call > > memory_add_physaddr_to_nid() by default, but fall back to searching > > reserved memory address ranges in memblock. See phys_to_target_node() > > in arch/x86/mm/numa.c. That one uses numa_meminfo instead of memblock, > > but the principle is the same i.e. that a target node may not be > > represented in memblock.memory, but memblock.reserved. I'm working on > > a patch to provide a function similar to get_pfn_range_for_nid() that > > operates on reserved memory. > > Do we really need yet another memblock iterator? > I think only x86 has memory that is not in memblock.memory but only in > memblock.reserved. Well, that's what led me here. EFI has introduced a memory attribute called "EFI Special Purpose Memory". I mapped it to a new Linux concept called Soft Reserved memory (commit b617c5266eed "efi: Common enable/disable infrastructure for EFI soft reservation"). The driver I want to claim that memory, device-dax, wants to be able to look up numa information for an address range that is marked reserved in memblock. The device-dax facility has the ability to either let userspace map a device, or assign the memory backing that device to the page allocator. In both scenarios the driver needs numa info to either populate the 'numa_node' property of the device in sysfs, or to pass an node-id to add_memory_resource() when it is hot-plugged. I was thwarted by the lack of phys_to_target_node() on arm64, and rather than add another stub like memory_add_physaddr_to_nid() I wanted to see if it could be solved properly / generically with memblock data. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel