<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 6, 2016 at 1:41 PM Rui Ueyama via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">As to leave an opportunity for the kernel, I think mmap+write would be enough. Because the kernel knows what address is mmap'ed, it can detect that write's source is actually a mmap'ed file and if that's the case it can optimize as it does for sendfile. It seems that Linux doesn't do that now, though.</div></blockquote><div><br></div><div>Pardon my ignorance here, but how might the kernel in general know what the "source" of a write is?</div><div><br></div><div>Also, in terms of the async_io option, in my (non-llvm) experimentation with reading very large files the aio subsystem is not well-supported or optimized  (hence the lack of Glibc support).</div></div></div>