mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
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:
parent
6101e74932
commit
a2694db751
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user