aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorThomas Gleixner <[email protected]>2024-10-07 16:50:17 +0000
committerThomas Gleixner <[email protected]>2024-10-15 15:30:33 +0000
commitf57ebb92ba3e09a7e1082f147d6e1456d702d4b2 (patch)
tree955c40bbc20e1a9801fb82933f8d12b77c3137b5 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parentdebugobjects: Prepare kmem_cache allocations for batching (diff)
downloadkernel-f57ebb92ba3e09a7e1082f147d6e1456d702d4b2.tar.gz
kernel-f57ebb92ba3e09a7e1082f147d6e1456d702d4b2.zip
debugobjects: Implement batch processing
Adding and removing single objects in a loop is bad in terms of lock contention and cache line accesses. To implement batching, record the last object in a batch in the object itself. This is trivialy possible as hlists are strictly stacks. At a batch boundary, when the first object is added to the list the object stores a pointer to itself in debug_obj::batch_last. When the next object is added to the list then the batch_last pointer is retrieved from the first object in the list and stored in the to be added one. That means for batch processing the first object always has a pointer to the last object in a batch, which allows to move batches in a cache line efficient way and reduces the lock held time. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/all/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
0 files changed, 0 insertions, 0 deletions