From patchwork Thu Aug 8 13:14:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 11085757 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 37BD3912 for ; Fri, 9 Aug 2019 09:16:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2849C28B38 for ; Fri, 9 Aug 2019 09:16:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C6ED28C3E; Fri, 9 Aug 2019 09:16:33 +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,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable 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 D751528B38 for ; Fri, 9 Aug 2019 09:16:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A4356ED6E; Fri, 9 Aug 2019 09:15:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE21D6E82F; Thu, 8 Aug 2019 13:14:48 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id p74so2378438wme.4; Thu, 08 Aug 2019 06:14:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QXg8/50/m0qICIMMrj9BArF0ioly+QuNwMno0BPcCis=; b=NJFf/66ySRN3oYJr+C8e651eEkV3NlRpvHXUPOyvkGWU+FfIOeUM2XM0zlErtOE91h PAU1LBcjUrqS9pXU0OyKb/aeIROx2gMfh5HAVi1t3Ilwr7t1PXhLZ2RkGEJx60inTgZX +AaUDngyxwpk8cEQ5EI5LllCVtXBCP04drsPBJThhu/9bfTgEnMN9W3ztRIrJ2fU5oHD LbVkfdtwoUwI1TJI87oYSiLl6AeOnE8Zq4fh17BY8GJVGTZ+q8+LqSgbi17j7eOB6m78 Ux5RtvOSTQ6gsWu4E1jiEDZWqfoUck8WhbRdXIQzNrr/sQVvrvZTN6u6Tm1IEQI9w7q0 S5nw== X-Gm-Message-State: APjAAAXHU+JnHCCmkD7J2MN0hu5hKDe5nxWmMyjcde2VEPf+2xI+rjq3 olFCgsmQIc8kq4GAGaoHyi63l4rv X-Google-Smtp-Source: APXvYqz4v7jvW8SeZLxgBZRe+Mur+zKiJsaWpJ/cyemYxpSuefyIwH4qfitJX9wD39m7n7u7ebgGZg== X-Received: by 2002:a7b:cb51:: with SMTP id v17mr4379575wmj.20.1565270087414; Thu, 08 Aug 2019 06:14:47 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:9969:2269:d9b7:abda]) by smtp.gmail.com with ESMTPSA id b8sm82907518wrr.43.2019.08.08.06.14.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 06:14:46 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Date: Thu, 8 Aug 2019 15:14:45 +0200 Message-Id: <20190808131445.23372-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 09 Aug 2019 09:15:44 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=QXg8/50/m0qICIMMrj9BArF0ioly+QuNwMno0BPcCis=; b=JrWkH/08LpKFenKS3BB1Sz3LBMpRUEPtE8Ed+vh8Hfr9aNkmBUr5YF5qeszncMqAf0 uPl6zBe3MnSar3DNKshkqFTb9i5rwg/yD8GCTnG56QfdFQGGP/lNEfTFwaYFdajyJzKq bPKtW4CXlYqkMdQwOBn36oTbriRxeF98OMRRNcrxi2FLo0lhFP34ccZ6kEjD38qkR+eI Rt/5XlxpWq2TPQCvXFzHdYn7BkjKDCesQX7iT9o1O7sWAGgoG2tL1QwFP86AsvDMvS65 WDXoay5LuumrIkeLdopMdBaT+AOYGYX5rD5nPwcHWPnnKKW30BLGPsQrv7Od1b67NdNv FcvQ== Subject: [Intel-gfx] [PATCH] dma-buf: make dma_fence structure a bit smaller X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 that they don't themselves hold a reference for. This small change is actually making the structure 16% smaller. Signed-off-by: Christian König Reviewed-by: Chris Wilson --- 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;