Re: [PATCHSET v2 0/15] Uncached buffered IO
From: Matthew Wilcox
Date: Mon Nov 11 2024 - 12:26:21 EST
On Sun, Nov 10, 2024 at 08:27:52AM -0700, Jens Axboe wrote:
> 5 years ago I posted patches adding support for RWF_UNCACHED, as a way
> to do buffered IO that isn't page cache persistent. The approach back
> then was to have private pages for IO, and then get rid of them once IO
> was done. But that then runs into all the issues that O_DIRECT has, in
> terms of synchronizing with the page cache.
Today's a holiday, and I suspect you're going to do a v3 before I have
a chance to do a proper review of this version of the series.
I think "uncached" isn't quite the right word. Perhaps 'RWF_STREAMING'
so that userspace is indicating that this is a streaming I/O and the
kernel gets to choose what to do with that information.
Also, do we want to fail I/Os to filesystems which don't support
it? I suppose really sophisticated userspace might fall back to
madvise(DONTNEED), but isn't most userspace going to just clear the flag
and retry the I/O?
Um. Now I've looked, we also have posix_fadvise(POSIX_FADV_NOREUSE),
which is currently a noop. But would we be better off honouring
POSIX_FADV_NOREUSE than introducing RWF_UNCACHED? I'll think about this
some more while I'm offline.