From patchwork Sat Aug 17 14:47:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 11099105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48F7114DB for ; Sat, 17 Aug 2019 14:47:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39E2D27EE2 for ; Sat, 17 Aug 2019 14:47:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DFDB28488; Sat, 17 Aug 2019 14:47:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E31C227EE2 for ; Sat, 17 Aug 2019 14:47:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B50D96E503; Sat, 17 Aug 2019 14:47:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id E16FC6E4FF; Sat, 17 Aug 2019 14:47:49 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 18173477-1500050 for multiple; Sat, 17 Aug 2019 15:47:39 +0100 From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] dma-fence: Shrink size of struct dma_fence Date: Sat, 17 Aug 2019 15:47:33 +0100 Message-Id: <20190817144736.7826-3-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20190817144736.7826-1-chris@chris-wilson.co.uk> References: <20190817144736.7826-1-chris@chris-wilson.co.uk> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, christian.koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Christian König Reviewed-by: Christian König --- 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; };