Question: Why does the modification of seq in write_seqlock not require WRITE_ONCE?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I noticed that the modifications of seq in write_seqlock and write_sequnlock of Listing 9.10 use plain ++ operation.
But as Chapter 4 (especially 4.3.4.4) says, there will be store tearing since there are concurrent readers.

However, the kernel implementation of sequence lock also uses plain ++ operation.

I’m somewhat confused.

Why does the modification of seq in write_seqlock not require WRITE_ONCE?

Thanks,
Alan



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux