On 09/01/2025 10:07, Amir Goldstein wrote:
Please note that IOCB_ATOMIC is not supported for buffered IO, so we
can't do this - we only support direct IO today.
Oops. I see now.
And supporting buffered IO has its challenges; how to handle overlapping
atomic writes of differing sizes sitting in the page cache is the main
issue which comes to mind.
How about the combination of RWF_ATOMIC | RWF_UNCACHED [1]
Would it be easier/possible to support this considering that the write of folio
is started before the write system call returns?
I am not sure exactly what you are proposing. Is it that RWF_ATOMIC for
buffered IO auto-sets RWF_UNCACHED? Or that RWF_ATOMIC requires
RWF_UNCACHED to be set?
But that is not so important, as I just think that future users of
RWF_ATOMIC may not want the behavior of RWF_UNCACHED always (for
buffered IO).
And I don't think that RWF_UNCACHED even properly solves the issues of
RWF_ATOMIC for buffered IO in terms of handling overlapping atomic
writes in the page cache.
Thanks,
John
Note that application that desires mutithreaded atomicity of writes vs. reads
will only need to opt-in for RWF_ATOMIC | RWF_UNCACHED writes, so this
is not expected to actually break its performance by killing the read caching.
Thanks,
Amir.
[1]https://urldefense.com/v3/__https://lore.kernel.org/linux-
fsdevel/20241220154831.1086649-1-axboe@xxxxxxxxx/__;!!ACWV5N9M2RV99hQ!
J7_5N_kSixl5iSy8IX37Cup3uKTHAaC5Oy-RlvsJeTE2kr3iJ2IXNww_rApK7TwI_ocCBSE-
G2vZSKSRHqY$