kernel/vm: Skip acquiring the available memory lock if there's nothing to unreserve.
This can happen when deleting VMCaches that were overcommitted or never had any reservation, or caches that had their commitments merged.
This commit is contained in:
@@ -4697,10 +4697,11 @@ vm_kernel_address_space_left(void)
|
||||
void
|
||||
vm_unreserve_memory(size_t amount)
|
||||
{
|
||||
if (amount == 0)
|
||||
return;
|
||||
|
||||
mutex_lock(&sAvailableMemoryLock);
|
||||
|
||||
sAvailableMemory += amount;
|
||||
|
||||
mutex_unlock(&sAvailableMemoryLock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user