]> www.infradead.org Git - users/hch/misc.git/commit
debugobjects: Prepare for batching
authorThomas Gleixner <tglx@linutronix.de>
Mon, 7 Oct 2024 16:50:14 +0000 (18:50 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Oct 2024 15:30:32 +0000 (17:30 +0200)
commit74fe1ad4132234f04fcc75e16600449496a67b5b
treeeb92068ae64f51c97e3f3a56cee2852dfc0c00c0
parent14077b9e583bbafc9a02734beab99c37bff68644
debugobjects: Prepare for batching

Move the debug_obj::object pointer into a union and add a pointer to the
last node in a batch. That allows to implement batch processing efficiently
by utilizing the stack property of hlist:

When the first object of a batch is added to the list, then the batch
pointer is set to the hlist node of the object itself. Any subsequent add
retrieves the pointer to the last node from the first object in the list
and uses that for storing the last node pointer in the newly added object.

Add the pointer to the data structure and ensure that all relevant pool
sizes are strictly batch sized. The actual batching implementation follows
in subsequent changes.

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