RE: [RFC] WRITE_ONCE_INC() and friends

From: David Laight
Date: Sun Apr 19 2020 - 14:02:55 EST


From: Petko Manolov
> Sent: 19 April 2020 10:45
> Recently I started reading up on KCSAN and at some point I ran into stuff like:
>
> WRITE_ONCE(ssp->srcu_lock_nesting[idx], ssp->srcu_lock_nesting[idx] + 1);
> WRITE_ONCE(p->mm->numa_scan_seq, READ_ONCE(p->mm->numa_scan_seq) + 1);

If all the accesses use READ/WRITE_ONCE() why not just mark the
structure field 'volatile'?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)