All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, christian.koenig@amd.com
Subject: [PATCH 3/6] dma-fence: Shrink size of struct dma_fence
Date: Sat, 17 Aug 2019 15:47:33 +0100	[thread overview]
Message-ID: <20190817144736.7826-3-chris@chris-wilson.co.uk> (raw)
In-Reply-To: <20190817144736.7826-1-chris@chris-wilson.co.uk>

Rearrange the couple of 32-bit atomics hidden amongst the field of
pointers that unnecessarily caused the compiler to insert some padding,
shrinks the size of the base struct dma_fence from 80 to 72 bytes on
x86-64.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
 include/linux/dma-fence.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 404aa748eda6..2ce4d877d33e 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -63,7 +63,7 @@ struct dma_fence_cb;
  * been completed, or never called at all.
  */
 struct dma_fence {
-	struct kref refcount;
+	spinlock_t *lock;
 	const struct dma_fence_ops *ops;
 	/* We clear the callback list on kref_put so that by the time we
 	 * release the fence it is unused. No one should be adding to the cb_list
@@ -73,11 +73,11 @@ struct dma_fence {
 		struct rcu_head rcu;
 		struct list_head cb_list;
 	};
-	spinlock_t *lock;
 	u64 context;
 	u64 seqno;
-	unsigned long flags;
 	ktime_t timestamp;
+	unsigned long flags;
+	struct kref refcount;
 	int error;
 };
 
-- 
2.23.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-08-17 14:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-17 14:47 [PATCH 1/6] dma-buf: Introduce selftesting framework Chris Wilson
2019-08-17 14:47 ` [PATCH 2/6] dma-buf: Add selftests for dma-fence Chris Wilson
2019-08-17 14:47 ` Chris Wilson [this message]
2019-08-17 14:47 ` [PATCH 4/6] dma-fence: Avoid list_del during fence->cb_list iteration Chris Wilson
2019-08-17 14:47 ` [PATCH 5/6] dma-fence: Simply wrap dma_fence_signal_locked with dma_fence_signal Chris Wilson
2019-08-17 15:16   ` Koenig, Christian
2019-08-17 15:23   ` [PATCH v3] " Chris Wilson
2019-08-17 15:25     ` Koenig, Christian
2019-08-17 14:47 ` [PATCH 6/6] dma-fence: Store the timestamp in the same union as the cb_list Chris Wilson
2019-08-17 15:20   ` Koenig, Christian
2019-08-17 15:27     ` Chris Wilson
2019-08-17 15:31       ` Koenig, Christian
2019-08-17 15:30   ` [PATCH v2] " Chris Wilson
2019-08-17 15:40     ` Koenig, Christian
2019-08-17 15:30 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] dma-buf: Introduce selftesting framework (rev2) Patchwork
2019-08-17 15:53 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-17 15:56 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] dma-buf: Introduce selftesting framework (rev3) Patchwork
2019-08-17 16:18 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-18  9:08 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190817144736.7826-3-chris@chris-wilson.co.uk \
    --to=chris@chris-wilson.co.uk \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.