On 12/12/19 8:47 AM, Christoph Hellwig wrote: > On Tue, Dec 10, 2019 at 09:24:49AM -0700, Jens Axboe wrote: >> Seems to me that we have an opportunity to provide something that sits >> somewhere in between buffered and O_DIRECT, and this is where >> RWF_UNCACHED enters the picture. If this flag is set on IO, we get the >> following behavior: >> >> - If the data is in cache, it remains in cache and the copy (in or out) >> is served to/from that. >> >> - If the data is NOT in cache, we add it while performing the IO. When >> the IO is done, we remove it again. >> >> With this, I can do 100% smooth buffered reads or writes without pushing >> the kernel to the state where kswapd is sweating bullets. In fact it >> doesn't even register. >> >> Comments appreciated! Patches are against current git (ish), and can >> also be found here: > > I can't say I particularly like the model, as it still has all the > page cache overhead. Direct I/O with bounce buffers for unaligned I/O > sounds simpler and faster to me. The current patchset read side does not, hopefully the same can be done on the write side. No page cache usage for reads, because it did indeed turn out to have too much overhead. -- Jens Axboe