[Intel-gfx] [PATCH] dma-buf: make dma_fence structure a bit smaller

Christian König ckoenig.leichtzumerken at gmail.com
Wed Aug 7 13:54:05 UTC 2019


The ruc and cb_list are never used at the same time.
This smal change is actually making the structure 16% smaller.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 include/linux/dma-fence.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 05d29dbc7e62..3985c72cd0c2 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -65,8 +65,10 @@ struct dma_fence_cb;
 struct dma_fence {
 	struct kref refcount;
 	const struct dma_fence_ops *ops;
-	struct rcu_head rcu;
-	struct list_head cb_list;
+	union {
+		struct rcu_head rcu;
+		struct list_head cb_list;
+	};
 	spinlock_t *lock;
 	u64 context;
 	u64 seqno;
-- 
2.17.1



More information about the Intel-gfx mailing list