Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1644203yba; Thu, 25 Apr 2019 03:23:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP2jwxRPF6P0IEJ3ofTARX5JQDshI+8nJ0CMoN3WqtaxfPbMnJPF8qp6ttFSoap8ZGEIZy X-Received: by 2002:a62:2a44:: with SMTP id q65mr7148693pfq.226.1556187786287; Thu, 25 Apr 2019 03:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556187786; cv=none; d=google.com; s=arc-20160816; b=pQNdhK2HZwygM8HpxeEft2D0dJogrCyybnqT6oy+a2B9HJM1VGqyTAPdWZaMYf7BLY j73A+hfoJAQ4oKwkeZIEi53140TlfjJEKJaOZewb5PdTj7LUUGov9mqA6sCpj7xcwAIy TMjUfiN597kGkyve+UkrG34aZ2gTsggshYRk28OuE+HTMXPVhyYBUB+4ibow6M9NTJ8C PZVDKqN28uv8pEt6/ncNytJidsckMm/L0+HrLnNCtrtKn5+XeVF8SXcvMj35aNu50iEf NS2rtj2XTEufKWQKfky82q4aGaOwtZQ05J+YQpkGa7NvcQm3qX1PRg8CWr7PTuaxumXe 7wkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0yqiQlK/8S9jDfOWBw0HKH7+HNI4EnlVsdp6B0GH1hI=; b=cJwGIpGCQwxf0nrNeeDhjhYn/X96tXU1WND61RLPb3uuV+dpNKf8J+yOzij2om0lG/ 4sxUmoVCJCHLP5DpfUaJa7nJURq05s5aqxheqW1Ir2MA70KR+EIZjey5eFtYO4V5/C/B yX8tROGGbo5Strty8DnLntwJ/iNngWOBw3wBDxt04bxxkaXj+ejtnb9ZhIoKVTGiwNbc EsvGRWUZqNFBxado4BGvlAuHu32BleXgH/RdWMrj/MsHh5eUQXRMvpUaAJaNR5DWGavy nPMgeYW1sWQafhcxiTyn190Qgc9xn5FPEq+/mVtmPdrKdYmh2KykJ3RBAfQVhzHJFbc5 z4xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si21117148pgi.19.2019.04.25.03.22.50; Thu, 25 Apr 2019 03:23:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388204AbfDYBmq (ORCPT + 99 others); Wed, 24 Apr 2019 21:42:46 -0400 Received: from mga11.intel.com ([192.55.52.93]:25341 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387460AbfDYBmn (ORCPT ); Wed, 24 Apr 2019 21:42:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2019 18:42:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,391,1549958400"; d="scan'208";a="152134215" Received: from zz23f_aep_wp03.sh.intel.com ([10.239.85.39]) by FMSMGA003.fm.intel.com with ESMTP; 24 Apr 2019 18:42:42 -0700 From: Fan Du To: akpm@linux-foundation.org, mhocko@suse.com, fengguang.wu@intel.com, dan.j.williams@intel.com, dave.hansen@intel.com, xishi.qiuxishi@alibaba-inc.com, ying.huang@intel.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Fan Du Subject: [RFC PATCH 1/5] acpi/numa: memorize NUMA node type from SRAT table Date: Thu, 25 Apr 2019 09:21:31 +0800 Message-Id: <1556155295-77723-2-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1556155295-77723-1-git-send-email-fan.du@intel.com> References: <1556155295-77723-1-git-send-email-fan.du@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark NUMA node as DRAM or PMEM. This could happen in boot up state (see the e820 pmem type override patch), or on fly when bind devdax device with kmem driver. It depends on BIOS supplying PMEM NUMA proximity in SRAT table, that's current production BIOS does. Signed-off-by: Fan Du --- arch/x86/include/asm/numa.h | 2 ++ arch/x86/mm/numa.c | 2 ++ drivers/acpi/numa.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index bbfde3d..5191198 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -30,6 +30,8 @@ */ extern s16 __apicid_to_node[MAX_LOCAL_APIC]; extern nodemask_t numa_nodes_parsed __initdata; +extern nodemask_t numa_nodes_pmem; +extern nodemask_t numa_nodes_dram; extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); extern void __init numa_set_distance(int from, int to, int distance); diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index dfb6c4d..3c3a1f5 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -20,6 +20,8 @@ int numa_off; nodemask_t numa_nodes_parsed __initdata; +nodemask_t numa_nodes_pmem; +nodemask_t numa_nodes_dram; struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; EXPORT_SYMBOL(node_data); diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 867f6e3..ec4b7a7e 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -298,6 +298,11 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) node_set(node, numa_nodes_parsed); + if (ma->flags & ACPI_SRAT_MEM_NON_VOLATILE) + node_set(node, numa_nodes_pmem); + else + node_set(node, numa_nodes_dram); + pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n", node, pxm, (unsigned long long) start, (unsigned long long) end - 1, -- 1.8.3.1