summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMike Rapoport (Microsoft) <rppt@kernel.org>2024-11-29 11:13:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-14 20:03:34 +0100
commit2cec2d916a7dbf01bd97862c214989f5ec579248 (patch)
tree3a48972becea24523676ca27bf8a98424052331c /mm
parent5c63e24b1bb7ded82cf21dfc8f7d2963fa3194c2 (diff)
downloadlinux-2cec2d916a7dbf01bd97862c214989f5ec579248.tar.gz
linux-2cec2d916a7dbf01bd97862c214989f5ec579248.tar.bz2
linux-2cec2d916a7dbf01bd97862c214989f5ec579248.zip
memblock: allow zero threshold in validate_numa_converage()
commit 9cdc6423acb49055efb444ecd895d853a70ef931 upstream. Currently memblock validate_numa_converage() returns false negative when threshold set to zero. Make the check if the memory size with invalid node ID is greater than the threshold exclusive to fix that. Link: https://lore.kernel.org/all/Z0mIDBD4KLyxyOCm@kernel.org/ Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 0389ce5cd281..095c18b5c430 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -735,7 +735,7 @@ int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
/**
* memblock_validate_numa_coverage - check if amount of memory with
* no node ID assigned is less than a threshold
- * @threshold_bytes: maximal number of pages that can have unassigned node
+ * @threshold_bytes: maximal memory size that can have unassigned node
* ID (in bytes).
*
* A buggy firmware may report memory that does not belong to any node.
@@ -755,7 +755,7 @@ bool __init_memblock memblock_validate_numa_coverage(unsigned long threshold_byt
nr_pages += end_pfn - start_pfn;
}
- if ((nr_pages << PAGE_SHIFT) >= threshold_bytes) {
+ if ((nr_pages << PAGE_SHIFT) > threshold_bytes) {
mem_size_mb = memblock_phys_mem_size() >> 20;
pr_err("NUMA: no nodes coverage for %luMB of %luMB RAM\n",
(nr_pages << PAGE_SHIFT) >> 20, mem_size_mb);