fill_pool() uses 'obj_pool_min_free' to decide whether objects should be handed back to the kmem cache. But 'obj_pool_min_free' records the lowest historical value of the number of objects in the object pool and not the minimum number of objects which should be kept in the pool. Use 'debug_objects_pool_min_level' instead, which holds the minimum number which was scaled to the number of CPUs at boot time. [ tglx: Massage change log ]
Showing the changes to lib/debugobjects.c (1 of 1 file). Show all
Unified · Split
| @@ -142,13 +142,14 @@ static void fill_pool(void) · 141 unmodified lines | ||
| 142 | 142 | * READ_ONCE()s pair with the WRITE_ONCE()s in pool_lock critical |
| 143 | 143 | * sections. |
| 144 | 144 | */ |
| 145 | − while (READ_ONCE(obj_nr_tofree) && (READ_ONCE(obj_pool_free) < obj_pool_min_free)) { | |
| 145 | + while (READ_ONCE(obj_nr_tofree) && | |
| 146 | + READ_ONCE(obj_pool_free) < debug_objects_pool_min_level) { | |
| 146 | 147 | raw_spin_lock_irqsave(&pool_lock, flags); |
| 147 | 148 | /* |
| 148 | 149 | * Recheck with the lock held as the worker thread might have |
| 149 | 150 | * won the race and freed the global free list already. |
| 150 | 151 | */ |
| 151 | − while (obj_nr_tofree && (obj_pool_free < obj_pool_min_free)) { | |
| 152 | + while (obj_nr_tofree && (obj_pool_free < debug_objects_pool_min_level)) { | |
| 152 | 153 | obj = hlist_entry(obj_to_free.first, typeof(*obj), node); |
| 153 | 154 | hlist_del(&obj->node); |
| 154 | 155 | WRITE_ONCE(obj_nr_tofree, obj_nr_tofree - 1); |