Add vmem locking to r281026.
While races there are not fatal, they cause result underestimation, that cause unneeded ARC reclaims. MFC after: 1 month
This commit is contained in:
parent
ba29f2ddfb
commit
cdd09fea28
@ -1330,12 +1330,15 @@ vmem_size(vmem_t *vm, int typemask)
|
||||
case VMEM_FREE|VMEM_ALLOC:
|
||||
return vm->vm_size;
|
||||
case VMEM_MAXFREE:
|
||||
VMEM_LOCK(vm);
|
||||
for (i = VMEM_MAXORDER - 1; i >= 0; i--) {
|
||||
if (LIST_EMPTY(&vm->vm_freelist[i]))
|
||||
continue;
|
||||
VMEM_UNLOCK(vm);
|
||||
return ((vmem_size_t)ORDER2SIZE(i) <<
|
||||
vm->vm_quantum_shift);
|
||||
}
|
||||
VMEM_UNLOCK(vm);
|
||||
return (0);
|
||||
default:
|
||||
panic("vmem_size");
|
||||
|
Loading…
x
Reference in New Issue
Block a user