mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
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
This commit is contained in:
parent
14077b9e58
commit
74fe1ad413
2 changed files with 15 additions and 7 deletions
|
|
@ -21,11 +21,15 @@
|
|||
#define ODEBUG_HASH_BITS 14
|
||||
#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)
|
||||
|
||||
#define ODEBUG_POOL_SIZE 1024
|
||||
#define ODEBUG_POOL_MIN_LEVEL 256
|
||||
#define ODEBUG_POOL_PERCPU_SIZE 64
|
||||
/* Must be power of two */
|
||||
#define ODEBUG_BATCH_SIZE 16
|
||||
|
||||
/* Initial values. Must all be a multiple of batch size */
|
||||
#define ODEBUG_POOL_SIZE (64 * ODEBUG_BATCH_SIZE)
|
||||
#define ODEBUG_POOL_MIN_LEVEL (ODEBUG_POOL_SIZE / 4)
|
||||
|
||||
#define ODEBUG_POOL_PERCPU_SIZE (4 * ODEBUG_BATCH_SIZE)
|
||||
|
||||
#define ODEBUG_CHUNK_SHIFT PAGE_SHIFT
|
||||
#define ODEBUG_CHUNK_SIZE (1 << ODEBUG_CHUNK_SHIFT)
|
||||
#define ODEBUG_CHUNK_MASK (~(ODEBUG_CHUNK_SIZE - 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue