[RFC] ring: improve ring performance with C11 atomics

Stephen Hemminger stephen at networkplumber.org
Fri Apr 21 23:27:06 CEST 2023


On Fri, 21 Apr 2023 19:14:46 +0000
Wathsala Vithanage <wathsala.vithanage at arm.com> wrote:

>  		/* Ensure the head is read before tail */
>  		__atomic_thread_fence(__ATOMIC_ACQUIRE);
>  
> -		/* load-acquire synchronize with store-release of ht->tail
> -		 * in update_tail.
> -		 */

This makes sense since tail is already synchronized by the previous thread fence.

Probably best to add the comment about ht->tail into the existing thread_fence comment.
Something like:
		/* Ensure that head is read before tail and that tail synchronized with update_tail */


More information about the dev mailing list