]> www.infradead.org Git - users/jedix/linux-maple.git/commit
debugobjects: Rework object allocation
authorThomas Gleixner <tglx@linutronix.de>
Mon, 7 Oct 2024 16:50:09 +0000 (18:50 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Oct 2024 15:30:32 +0000 (17:30 +0200)
commitfb60c004f33e0fa2e87b9456b87f1b2709436b88
treef2a0c16459c7465732a3b32c6f681d20a5b1c50d
parent96a9a0421c77301f9b551f3460ac04471a3c0612
debugobjects: Rework object allocation

The current allocation scheme tries to allocate from the per CPU pool
first. If that fails it allocates one object from the global pool and then
refills the per CPU pool from the global pool.

That is in the way of switching the pool management to batch mode as the
global pool needs to be a strict stack of batches, which does not allow
to allocate single objects.

Rework the code to refill the per CPU pool first and then allocate the
object from the refilled batch. Also try to allocate from the to free pool
first to avoid freeing and reallocating objects.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/all/20241007164913.893554162@linutronix.de
lib/debugobjects.c