Re: [PATCH] inode: remove __I_DIO_WAKEUP

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

 



On Sat, Aug 17, 2024 at 9:25 AM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
>
> > ... atomic_read and atomic_set -- these merely expand to regular movs, ...
>
> Ah, no, that's not necessarily true.  See arch/parisc/include/asm/atomic.h.
>

In that context I was talking about amd64.

atomic_read/set do happen to provide some fencing on some archs, but
there are no guarantees as far as LKMM is concerned -- for example
atomic_read is explicitly documented to only provide relaxed ordering
(aka no guarantees).

In particular on amd64 the full memory barrier normally coming with
lock-prefixed instructions (and xchg with a memory operand) is not
present here because this merely expands to a regular mov, making the
code bogus if such a fence is indeed required in this code.

-- 
Mateusz Guzik <mjguzik gmail.com>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux