kernel/slab: Check both pressure and min_object_reserve before returning slabs.

Otherwise, if the pressure is low, then we won't properly respect
the min_object_reserve.
This commit is contained in:
Augustin Cavalier 2024-11-04 16:07:39 -05:00
parent 6101e74932
commit a2694db751

View File

@ -232,8 +232,8 @@ ObjectCache::ReturnObjectToSlab(slab* source, void* object, uint32 flags)
partial.Remove(source);
if (empty_count < pressure
&& total_objects - used_count - source->size
>= min_object_reserve) {
|| (total_objects - (used_count + source->size))
< min_object_reserve) {
empty_count++;
empty.Add(source);
} else {