Revert "debugobjects: Fix conditions in fill_pool()"

This reverts commit 85befa7c4a.
This commit is contained in:
Ksawlii 2024-11-24 00:23:16 +01:00
parent 02b4e700f3
commit a672f093cd

View file

@ -144,14 +144,13 @@ static void fill_pool(void)
* READ_ONCE()s pair with the WRITE_ONCE()s in pool_lock critical
* sections.
*/
while (READ_ONCE(obj_nr_tofree) &&
READ_ONCE(obj_pool_free) < debug_objects_pool_min_level) {
while (READ_ONCE(obj_nr_tofree) && (READ_ONCE(obj_pool_free) < obj_pool_min_free)) {
raw_spin_lock_irqsave(&pool_lock, flags);
/*
* Recheck with the lock held as the worker thread might have
* won the race and freed the global free list already.
*/
while (obj_nr_tofree && (obj_pool_free < debug_objects_pool_min_level)) {
while (obj_nr_tofree && (obj_pool_free < obj_pool_min_free)) {
obj = hlist_entry(obj_to_free.first, typeof(*obj), node);
hlist_del(&obj->node);
WRITE_ONCE(obj_nr_tofree, obj_nr_tofree - 1);