From: kirill.shutemov@xxxxxxxxxxxxxxx > Sent: 12 June 2023 12:49 > > On Mon, Jun 12, 2023 at 10:27:44AM +0000, Huang, Kai wrote: > > Does it make sense? > > I understand your logic. AFAICS, it is correct (smp_mb() instead of __mb() > would be better), but it is not justified from complexity PoV. Given that x86 performs writes pretty much in code order. Do you need anything more than a compile barrier? > This lockless exercise gave me a pause to understand. > > Lockless doesn't buy you anything here, only increases complexity. > Just take a lock. Indeed... David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)