Merge pull request #746 from uvletter/fix_vtoslab

Fix vtoslab doesn't return the correct slab
This commit is contained in:
johnjiang 2023-03-13 12:15:26 +08:00 committed by GitHub
commit 7201280ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;