Re: [PATCH] dma-buf: Shrink size of struct dma_fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Koenig, Christian (2019-08-17 12:42:48)
> Am 17.08.19 um 13:39 schrieb Chris Wilson:
> > 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@xxxxxxxxxxxxxxxxxx>
> > Cc: Christian König <christian.koenig@xxxxxxx>
> 
> Reviewed-by: Christian König <christian.koenig@xxxxxxx>
> 
> BTW: We could also put the timestamp in the union if we want.
> 
> E.g. the cb_list should only be used while the fence is unsignaled, the 
> timestamp while it is signaled and the rcu while it is freed.
> 
> Would save another 8 bytes, bringing us down to 64.

I was looking at packing the error into the flags and shrinking that to
32b to fit inside the magical 64 bytes. You are right about the
timestamp being mutually exclusive with the cb_list. The only caveat
being that no reader would be allowed access to the timestamp unless
they hold a reference (which I think covers all current users).
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux