From 5ed6baeedbf9750e3a14c2bbd4f9aa2481f16d0f Mon Sep 17 00:00:00 2001 From: zhutian Date: Fri, 3 Mar 2023 21:01:53 +0800 Subject: [PATCH] fix that vtoslab doesn't return the correct slab --- lib/include/vm/uma_int.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/vm/uma_int.h b/lib/include/vm/uma_int.h index a85d0ef74..2805f96b0 100644 --- a/lib/include/vm/uma_int.h +++ b/lib/include/vm/uma_int.h @@ -76,7 +76,7 @@ vtoslab(vm_offset_t va) hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)]; LIST_FOREACH(up, hash_list, list_entry) - if (up->up_va == va) + if (up->up_va == (va & (~(PAGE_SIZE - 1)))) return (up->up_slab); return (NULL); } @@ -89,7 +89,7 @@ vtozoneslab(vm_offset_t va, uma_zone_t *zone, uma_slab_t *slab) hash_list = &uma_page_slab_hash[UMA_PAGE_HASH(va)]; LIST_FOREACH(up, hash_list, list_entry) - if (up->up_va == va) + if (up->up_va == (va & (~(PAGE_SIZE - 1)))) break; *slab = up->up_slab;