git: 8daee410d2c1 - main - vm: Use vmem_xalloc in kva_alloc

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Thu, 30 Nov 2023 11:24:31 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=8daee410d2c13b4e8530b00e7877eeecf30bb064

commit 8daee410d2c13b4e8530b00e7877eeecf30bb064
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-11-29 12:11:37 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-11-30 10:50:03 +0000

    vm: Use vmem_xalloc in kva_alloc
    
    The kernel_arena used in kva_alloc has the qcache disabled. vmem_alloc
    will first try to use the qcache before falling back to vmem_xalloc.
    
    Rather than trying to use the qcache in vmem_alloc just call
    vmem_xalloc directly.
    
    Reviewed by:    alc, kib, markj
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D42831
---
 sys/vm/vm_kern.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index c2c908b3dc94..6b22a96bf597 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -147,7 +147,8 @@ kva_alloc(vm_size_t size)
 
 	TSENTER();
 	size = round_page(size);
-	if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr))
+	if (vmem_xalloc(kernel_arena, size, 0, 0, 0, VMEM_ADDR_MIN,
+	    VMEM_ADDR_MAX, M_BESTFIT | M_NOWAIT, &addr))
 		return (0);
 	TSEXIT();
 
@@ -168,7 +169,7 @@ kva_free(vm_offset_t addr, vm_size_t size)
 {
 
 	size = round_page(size);
-	vmem_free(kernel_arena, addr, size);
+	vmem_xfree(kernel_arena, addr, size);
 }
 
 /*