From: Dan Williams <dan.j.williams@intel.com> To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-nvdimm@lists.01.org, peterz@infradead.org, dave.hansen@linux.intel.com, ard.biesheuvel@linaro.org, linux-efi@vger.kernel.org Subject: [PATCH v3 02/10] acpi/numa/hmat: Skip publishing target info for nodes with no online memory Date: Fri, 07 Jun 2019 12:27:23 -0700 [thread overview] Message-ID: <155993564325.3036719.4434467326728129836.stgit@dwillia2-desk3.amr.corp.intel.com> (raw) In-Reply-To: <155993563277.3036719.17400338098057706494.stgit@dwillia2-desk3.amr.corp.intel.com> There are multiple scenarios where the HMAT may contain information about proximity domains that are not currently online. Rather than fail to report any HMAT data just elide those offline domains. If and when those domains are later onlined they can be added to the HMEM reporting at that point. This was found while testing EFI_MEMORY_SP support which reserves "specific purpose" memory from the general allocation pool. If that reservation results in an empty numa-node then the node is not marked online leading a spurious: "acpi/hmat: Ignoring HMAT: Invalid table" ...result for HMAT parsing. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/acpi/numa/hmat.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 96b7d39a97c6..2c220cb7b620 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -96,9 +96,6 @@ static __init void alloc_memory_target(unsigned int mem_pxm) { struct memory_target *target; - if (pxm_to_node(mem_pxm) == NUMA_NO_NODE) - return; - target = find_mem_target(mem_pxm); if (target) return; @@ -588,6 +585,17 @@ static __init void hmat_register_targets(void) struct memory_target *target; list_for_each_entry(target, &targets, node) { + int nid = pxm_to_node(target->memory_pxm); + + /* + * Skip offline nodes. This can happen when memory + * marked EFI_MEMORY_SP, "specific purpose", is applied + * to all the memory in a promixity domain leading to + * the node being marked offline / unplugged, or if + * memory-only "hotplug" node is offline. + */ + if (nid == NUMA_NO_NODE || !node_online(nid)) + continue; hmat_register_target_initiators(target); hmat_register_target_perf(target); } _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm
WARNING: multiple messages have this Message-ID (diff)
From: Dan Williams <dan.j.williams@intel.com> To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, vishal.l.verma@intel.com, dave.hansen@linux.intel.com, ard.biesheuvel@linaro.org, linux-nvdimm@lists.01.org, x86@kernel.org, linux-efi@vger.kernel.org Subject: [PATCH v3 02/10] acpi/numa/hmat: Skip publishing target info for nodes with no online memory Date: Fri, 07 Jun 2019 12:27:23 -0700 [thread overview] Message-ID: <155993564325.3036719.4434467326728129836.stgit@dwillia2-desk3.amr.corp.intel.com> (raw) In-Reply-To: <155993563277.3036719.17400338098057706494.stgit@dwillia2-desk3.amr.corp.intel.com> There are multiple scenarios where the HMAT may contain information about proximity domains that are not currently online. Rather than fail to report any HMAT data just elide those offline domains. If and when those domains are later onlined they can be added to the HMEM reporting at that point. This was found while testing EFI_MEMORY_SP support which reserves "specific purpose" memory from the general allocation pool. If that reservation results in an empty numa-node then the node is not marked online leading a spurious: "acpi/hmat: Ignoring HMAT: Invalid table" ...result for HMAT parsing. Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- drivers/acpi/numa/hmat.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/numa/hmat.c b/drivers/acpi/numa/hmat.c index 96b7d39a97c6..2c220cb7b620 100644 --- a/drivers/acpi/numa/hmat.c +++ b/drivers/acpi/numa/hmat.c @@ -96,9 +96,6 @@ static __init void alloc_memory_target(unsigned int mem_pxm) { struct memory_target *target; - if (pxm_to_node(mem_pxm) == NUMA_NO_NODE) - return; - target = find_mem_target(mem_pxm); if (target) return; @@ -588,6 +585,17 @@ static __init void hmat_register_targets(void) struct memory_target *target; list_for_each_entry(target, &targets, node) { + int nid = pxm_to_node(target->memory_pxm); + + /* + * Skip offline nodes. This can happen when memory + * marked EFI_MEMORY_SP, "specific purpose", is applied + * to all the memory in a promixity domain leading to + * the node being marked offline / unplugged, or if + * memory-only "hotplug" node is offline. + */ + if (nid == NUMA_NO_NODE || !node_online(nid)) + continue; hmat_register_target_initiators(target); hmat_register_target_perf(target); }
next prev parent reply other threads:[~2019-06-07 19:41 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-06-07 19:27 [PATCH v3 00/10] EFI Specific Purpose Memory Support Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 01/10] acpi/numa: Establish a new drivers/acpi/numa/ directory Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-10 11:02 ` Rafael J. Wysocki 2019-06-10 11:02 ` Rafael J. Wysocki 2019-06-07 19:27 ` Dan Williams [this message] 2019-06-07 19:27 ` [PATCH v3 02/10] acpi/numa/hmat: Skip publishing target info for nodes with no online memory Dan Williams 2019-06-07 19:27 ` [PATCH v3 03/10] efi: Enumerate EFI_MEMORY_SP Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:53 ` Dave Hansen 2019-06-07 19:53 ` Dave Hansen 2019-06-07 20:03 ` Dan Williams 2019-06-07 20:03 ` Dan Williams 2019-06-07 21:12 ` Dave Hansen 2019-06-07 21:12 ` Dave Hansen 2019-06-07 22:07 ` Dan Williams 2019-06-07 22:07 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 04/10] x86, efi: Push EFI_MEMMAP check into leaf routines Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 05/10] x86, efi: Reserve UEFI 2.8 Specific Purpose Memory for dax Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 06/10] x86, efi: Add efi_fake_mem support for EFI_MEMORY_SP Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 07/10] lib/memregion: Uplevel the pmem "region" ida to a global allocator Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 20:23 ` Matthew Wilcox 2019-06-07 20:23 ` Matthew Wilcox 2019-06-21 20:35 ` Dan Williams 2019-06-21 20:35 ` Dan Williams 2019-08-27 5:48 ` Dan Williams 2019-08-27 5:48 ` Dan Williams 2019-06-07 19:27 ` [PATCH v3 08/10] device-dax: Add a driver for "hmem" devices Dan Williams 2019-06-07 19:27 ` Dan Williams 2019-06-07 19:54 ` Dave Hansen 2019-06-07 19:54 ` Dave Hansen 2019-06-07 20:07 ` Dan Williams 2019-06-07 20:07 ` Dan Williams 2019-06-07 19:28 ` [PATCH v3 09/10] acpi/numa/hmat: Register HMAT at device_initcall level Dan Williams 2019-06-07 19:28 ` Dan Williams 2019-06-07 19:28 ` [PATCH v3 10/10] acpi/numa/hmat: Register "specific purpose" memory as an "hmem" device Dan Williams 2019-06-07 19:28 ` Dan Williams 2019-06-07 19:57 ` [PATCH v3 00/10] EFI Specific Purpose Memory Support Dave Hansen 2019-06-07 19:57 ` Dave Hansen 2019-06-07 20:37 ` Dan Williams 2019-06-07 20:37 ` Dan Williams
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=155993564325.3036719.4434467326728129836.stgit@dwillia2-desk3.amr.corp.intel.com \ --to=dan.j.williams@intel.com \ --cc=ard.biesheuvel@linaro.org \ --cc=dave.hansen@linux.intel.com \ --cc=linux-efi@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvdimm@lists.01.org \ --cc=peterz@infradead.org \ --cc=x86@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.