On Wed, Dec 13, 2023 at 09:32:06AM +0000, John Garry wrote:
That would require a concrete use case. The simples thing for a fileok, but it would be nice to have some idea on what that flag or limit- How to make API extensible for when we have no HW support? In that case,I don't think the power of two length is much of a problem to be
we would prob not have to follow rule of power-of-2 length et al.
As a possible solution, maybe we can say that atomic writes are
supported for the file via statx, but not set unit_min and max values,
and this means that writes need to be just FS block aligned there.
honest, and if we every want to lift it we can still do that easily
by adding a new flag or limit.
change would be.
system that can or does log I/O it would simply be a flag waving all
the alignment and size requirements.
Maybe not much. But that's not what it is about - we need a commonI suspect we need an on-disk flag that forces allocations to beHmmm... so how is this different to the XFS forcealign feature?
aligned to the atomic write limit, in some ways similar how the
XFS rt flag works. You'd need to set it on an empty file, and all
allocations after that are guaranteed to be properly aligned.
API for this and not some XFS internal flag. So if this is something
we could support in ext4 as well that would be a good step. And for
btrfs you'd probably want to support something like it in nocow mode
if people care enough, or always support atomics and write out of
place.
For XFS, I thought that your idea was to always CoW new extents forWell, that is useful for two things:
misaligned extents or writes which spanned multiple extents.
- atomic writes on hardware that does not support it
- atomic writes for bufferd I/O
- supporting other sizes / alignments than the strict power of
two above.
Right, so we should limit atomic write queue limits to max_hw_sectors. ButAllowing people to tweak it seems to be asking for trouble.
people can still tweak max_sectors, and I am inclined to say that
atomic_write_unit_max et al should be (dynamically) limited to max_sectors
also.
No.have that silly limit. For NVMe that would require SGL supportIf we could avoid dealing with a virt boundary, then that would be nice.
(and some driver changes I've been wanting to make for long where
we always use SGLs for transfers larger than a single PRP if supported)
Are there any patches yet for the change to always use SGLs for transfers
larger than a single PRP?
On a related topic, I am not sure about how - or if we even should -Anything that just advices the user an it not clear cut and results in
enforce iovec PAGE-alignment or length; rather, the user could just be
advised that iovecs must be PAGE-aligned and min PAGE length to achieve
atomic_write_unit_max.
an error is data loss waiting to happen. Even more so if it differs
from device to device.