<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 8:55 PM, Emmanuel Dreyfus <span dir="ltr">&lt;<a href="mailto:manu@netbsd.org" target="_blank">manu@netbsd.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Anand Avati &lt;<a href="mailto:avati@gluster.org">avati@gluster.org</a>&gt; wrote:<br>
<br>
&gt; That may / may not work well in practice depending on the number of<br>
&gt; concurrent apps working on a file.<br>
<br>
</div>I am not sure what could make a FS decide that for the same file, one<br>
file descriptor should use direct I/O and another should not.<br>
<br>
Keeping the flag at file descriptor level would require VFS modification<br>
in the kernel: the filesystem knows nothing about file descriptors, it<br>
just know vnodes. It could be done, but I expect to meet resistance :-)<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>For e.g, glusterfs used to enable directio mode for non-read-only FDs (to cut overheads) but disable directio for read-only (to leverage readahead). After big_writes was introduced in Linux FUSE this has changed.</div>
<div><br></div><div>But we should be OK having vnode level switch for now, I think.</div></div></div></div>