History

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.

Thomas Gleixner committed 2 years ago

Commit 74fe1ad1 parent 14077b92 files · +15 −7Browse files

Showing the changes to lib/debugobjects.c (1 of 2 files). Show all

Unified · Split

lib/debugobjects.c+7−3
@@ -21,11 +21,15 @@ · 20 unmodified lines
21#define ODEBUG_HASH_BITS 1421#define ODEBUG_HASH_BITS 14
22#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)22#define ODEBUG_HASH_SIZE (1 << ODEBUG_HASH_BITS)
23 23
24#define ODEBUG_POOL_SIZE 102424/* Must be power of two */
25#define ODEBUG_POOL_MIN_LEVEL 256
26#define ODEBUG_POOL_PERCPU_SIZE 64
27#define ODEBUG_BATCH_SIZE 1625#define ODEBUG_BATCH_SIZE 16
28 26
27/* Initial values. Must all be a multiple of batch size */
28#define ODEBUG_POOL_SIZE (64 * ODEBUG_BATCH_SIZE)
29#define ODEBUG_POOL_MIN_LEVEL (ODEBUG_POOL_SIZE / 4)
30
31#define ODEBUG_POOL_PERCPU_SIZE (4 * ODEBUG_BATCH_SIZE)
32
29#define ODEBUG_CHUNK_SHIFT PAGE_SHIFT33#define ODEBUG_CHUNK_SHIFT PAGE_SHIFT
30#define ODEBUG_CHUNK_SIZE (1 << ODEBUG_CHUNK_SHIFT)34#define ODEBUG_CHUNK_SIZE (1 << ODEBUG_CHUNK_SHIFT)
31#define ODEBUG_CHUNK_MASK (~(ODEBUG_CHUNK_SIZE - 1))35#define ODEBUG_CHUNK_MASK (~(ODEBUG_CHUNK_SIZE - 1))