From d38d90de25c9de168663422ee20d052bba1a2f06 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 9 Mar 2022 18:17:35 -0500 Subject: [PATCH] kernel/vm: Notify the low_resource manager on low_resource address space. We cannot wait here, but now that the low_resource manager actually does something with the information it is provided, we can invoke it. --- src/system/kernel/vm/vm.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 8e59b1aa5b..bada48aad1 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -1014,11 +1014,9 @@ map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset, allocationFlags, _virtualAddress); if (status == B_NO_MEMORY && addressRestrictions->address_specification == B_ANY_KERNEL_ADDRESS) { - // TODO: At present, there is no way to notify the low_resource monitor - // that kernel addresss space is fragmented, nor does it check for this - // automatically. Due to how many locks are held, we cannot wait here - // for space to be freed up, but it would be good to at least notify - // that we tried and failed to allocate some amount. + // Due to how many locks are held, we cannot wait here for space to be + // freed up, but we can at least notify the low_resource handler. + low_resource(B_KERNEL_RESOURCE_ADDRESS_SPACE, size, B_RELATIVE_TIMEOUT, 0); } if (status != B_OK) goto err2;