Mesa (master): iris: remove hole from struct iris_bo

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 15 21:49:14 UTC 2020


Module: Mesa
Branch: master
Commit: f3f5016c0bfe5dbe85015dc1c3f41848b02dd245
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f3f5016c0bfe5dbe85015dc1c3f41848b02dd245

Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
Date:   Mon Mar 30 17:06:32 2020 -0700

iris: remove hole from struct iris_bo

This decreases the size of the struct on a 64bit machine from 144 to
136. While that's not a lot, this is one of the structs that we're
allocating all the time.

For a full Aztec run on BDW we allocate this struct 3273 times, and we
can have up to 3259 of them live at the same time. So we end up saving
just a little over 6 pages for this benchmark.

Spotted this while trying to add another bool for an unrelated
feature.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4561>

---

 src/gallium/drivers/iris/iris_bufmgr.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h
index 6f4bcbf5e56..d7edda23aca 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.h
+++ b/src/gallium/drivers/iris/iris_bufmgr.h
@@ -101,6 +101,9 @@ struct iris_bo {
    /** Buffer manager context associated with this buffer object */
    struct iris_bufmgr *bufmgr;
 
+   /** Pre-computed hash using _mesa_hash_pointer for cache tracking sets */
+   uint32_t hash;
+
    /** The GEM handle for this buffer object. */
    uint32_t gem_handle;
 
@@ -132,15 +135,6 @@ struct iris_bo {
     */
    unsigned index;
 
-   /**
-    * Boolean of whether the GPU is definitely not accessing the buffer.
-    *
-    * This is only valid when reusable, since non-reusable
-    * buffers are those that have been shared with other
-    * processes, so we don't know their state.
-    */
-   bool idle;
-
    int refcount;
    const char *name;
 
@@ -172,6 +166,15 @@ struct iris_bo {
    /** BO cache list */
    struct list_head head;
 
+   /**
+    * Boolean of whether the GPU is definitely not accessing the buffer.
+    *
+    * This is only valid when reusable, since non-reusable
+    * buffers are those that have been shared with other
+    * processes, so we don't know their state.
+    */
+   bool idle;
+
    /**
     * Boolean of whether this buffer can be re-used
     */
@@ -191,9 +194,6 @@ struct iris_bo {
     * Boolean of whether this buffer points into user memory
     */
    bool userptr;
-
-   /** Pre-computed hash using _mesa_hash_pointer for cache tracking sets */
-   uint32_t hash;
 };
 
 #define BO_ALLOC_ZEROED     (1<<0)



More information about the mesa-commit mailing list