git: 2e7838ae84c6 - main - vm_phys_early_alloc: mem_index is only used under #ifdef NUMA.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 09 Apr 2022 00:27:51 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=2e7838ae84c668fcfe9a4385c65d06fbfa1214a0
commit 2e7838ae84c668fcfe9a4385c65d06fbfa1214a0
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-09 00:25:13 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-09 00:25:13 +0000
vm_phys_early_alloc: mem_index is only used under #ifdef NUMA.
Possibly mem_index should just reuse biggestone since this loop is
already reusing biggestsize.
---
sys/vm/vm_phys.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 33c46fe7c481..4e87a90fa154 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -1660,7 +1660,10 @@ vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end)
vm_paddr_t
vm_phys_early_alloc(int domain, size_t alloc_size)
{
- int i, mem_index, biggestone;
+#ifdef NUMA
+ int mem_index;
+#endif
+ int i, biggestone;
vm_paddr_t pa, mem_start, mem_end, size, biggestsize, align;
KASSERT(domain == -1 || (domain >= 0 && domain < vm_ndomains),
@@ -1672,10 +1675,10 @@ vm_phys_early_alloc(int domain, size_t alloc_size)
* the phys_avail selection below.
*/
biggestsize = 0;
- mem_index = 0;
mem_start = 0;
mem_end = -1;
#ifdef NUMA
+ mem_index = 0;
if (mem_affinity != NULL) {
for (i = 0;; i++) {
size = mem_affinity[i].end - mem_affinity[i].start;