]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
debugobjects: Fix conditions in fill_pool()
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 4 Sep 2024 13:39:40 +0000 (21:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:53 +0000 (16:29 +0200)
commit534230eebae5e8c99fe26d4e6ef5d37b54ffd18a
treed0cc9464f2ffced1c355ff24395bc27672fa82d8
parentc1ba1f2ca1b89f56e9be95b5480cc75b35a02aea
debugobjects: Fix conditions in fill_pool()

commit 684d28feb8546d1e9597aa363c3bfcf52fe250b7 upstream.

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 ]

Fixes: d26bf5056fc0 ("debugobjects: Reduce number of pool_lock acquisitions in fill_pool()")
Fixes: 36c4ead6f6df ("debugobjects: Add global free list and the counter")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240904133944.2124-3-thunder.leizhen@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/debugobjects.c