memory order seq cst for atomics

Greg KH greg at kroah.com
Fri Apr 2 11:09:53 EDT 2021


On Fri, Apr 02, 2021 at 08:15:12PM +0530, Navin P wrote:
> Hi,
>   C11 and c++11  have memory order like memory_order_seq_cst .What is the
> equivalent in Linux kernel ?
> atomic64_inc(&var) ;
> __SMP_mb();

Please read Documentation/memory-barriers.txt in the kernel source tree.
It should answer all of your questions regarding this.

good luck!

greg k-h



More information about the Kernelnewbies mailing list