]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memblock: allow zero threshold in validate_numa_converage()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Fri, 29 Nov 2024 09:13:47 +0000 (11:13 +0200)
committerMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 1 Dec 2024 19:08:56 +0000 (21:08 +0200)
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>
mm/memblock.c

index 0389ce5cd281e106fa8be605d8a87ac2f51b4a01..095c18b5c430daa551a3220a26400574847a6d49 100644 (file)
@@ -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);