]> git.baikalelectronics.ru Git - kernel.git/commit
dma-fence: Store the timestamp in the same union as the cb_list
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 17 Aug 2019 15:30:22 +0000 (16:30 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 17 Aug 2019 17:46:33 +0000 (18:46 +0100)
commitb9a83a83711becae1e8d131418b997779278414a
tree62b3bc44752ee688d651354aedf6742ffb8b51e0
parent6724610e4799c946f74968285a05693aebda756e
dma-fence: Store the timestamp in the same union as the cb_list

The timestamp and the cb_list are mutually exclusive, the cb_list can
only be added to prior to being signaled (and once signaled we drain),
while the timestamp is only valid upon being signaled. Both the
timestamp and the cb_list are only valid while the fence is alive, and
as soon as no references are held can be replaced by the rcu_head.

By reusing the union for the timestamp, we squeeze the base dma_fence
struct to 64 bytes on x86-64.

v2: Sort the union chronologically

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>.
Link: https://patchwork.freedesktop.org/patch/msgid/20190817153022.5749-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence.c
drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
include/linux/dma-fence.h