On Tue, Nov 6, 2018 at 5:54 AM Fumiya Shigemitsu <shfy1014(a)gmail.com> wrote:
Hi all,
I have a question about atomic operations on nvdimm in Linux kernel.
We can use atomic operations in Linux kernel such as atomic_read(),
atomic_write() ...etc., but they don't handle the differences of
endianness. From my understanding, we should pay attention to them when
storing data to persistent disk. (e.g. metadata in filesystem such as ext4)
Maybe I can handle this problem by read/write lock, spinlock...etc.
However, atomic_* operations are useful, so I think that they should be in
Linux kernel for nvdimm. I suppose that this implementation is not
difficult, but there is no version of it as far as I know.
They are not just implemented or is there a reason that we don't need
them?
As far as I can see we don't need them. The "on-disk" format of
filesystem metadata is host-endian independent, Current filesystems
don't use atomic-ops for metadata manipulation since they expect to
submit block-layer requests for metadata I/O.