Anton Khirnov:
> Quoting Andreas Rheinhardt (2024-04-17 11:29:18)
>> Anton Khirnov:
>>> It is more efficient and easier to manage.
>>> ---
>>
>> Allocating structures used by slice contexts jointly has the potential
>> downside of false sharing if the structures are not sufficiently
>> aligned/padded.
> 
> What do you suggest? Align first member to cacheline size?
> 

This is problematic, because av_malloc is not necessarily aligned to the
chacheline size; for the same reason it is not possible to simply
DECLARE_ALIGNED_64 for it (see e.g.
7945d30e91b96d2f4f5b612048169087d214d41e). Given that the structure we
are talking about is already pretty big, the easiest way is to add
explicit padding at the end. Use __GCC_DESTRUCTIVE_SIZE if that is
defined or 64 if not (or maybe always use 128B?
https://stackoverflow.com/questions/72126606/should-the-cache-padding-size-of-x86-64-be-128-bytes).

- Andreas

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to