<div dir="ltr">On Mon, Apr 9, 2018 at 10:42 PM, Raghavendra Gowdappa <span dir="ltr">&lt;<a href="mailto:rgowdapp@redhat.com" target="_blank">rgowdapp@redhat.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">+Manoj.<br><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Mon, Apr 9, 2018 at 10:18 PM, riya khanna <span dir="ltr">&lt;<a href="mailto:riyakhanna1983@gmail.com" target="_blank">riyakhanna1983@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All,<div><br></div><div>I&#39;m trying to use the new framework to speed up lookups/attr/xattr operations by split functionality between fast/slow execution paths. I&#39;d highly appreciate if you could suggest experiments to evaluate the performance improvement.</div></div></blockquote><div><br></div></span><div>As you&#39;ve pointed out already, this is a good place for read caches (both data and metadata). While there is an overlap between things cached by kernel and things cached by glusterfs, there are somethings which are cached only by glusterfs but not by VFS/kernel. I think this is the area we can explore to move these caches into kernel. Things I can think of:</div><div><br></div></div></div></div></div></blockquote><div> </div><div>Even if things are cached by VFS (e.g., dir entries, attributes, etc.). The size of VFS dcache is limited and can affect performance when under pressure. Have you ever experienced such as case? Nevertheless, with the new framework can help create your own dir/attr cache managed by the user-space daemon - lets call it self-managed dcache. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div></div><div>* xattr caching - done by md-cache in glusterfs. I am not sure whether VFS caches xattrs. If not, this can yield good returns for workloads involving xattrs (like POSIX acls etc).</div></div></div></div></div></blockquote><div><br></div><div>Thanks! Similar to attr, xattr caching should be doable as well. I can start by looking at the existing implementation in md-cache. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div>* GET kind of interface for small files - done by quick-read in glusterfs. Note that we fetch the file in lookup. If we couple this with pushing open-behind in kernel, we can prevent open/readv/flush/release to glusterfs completely in suitable workloads (We had earlier found that this boosts performance for webserver usecases). I think in lookup response, we would&#39;ve to populate page cache. Also lookup response signature doesn&#39;t provide for holding this data. Not sure whether this can be done.</div><div></div></div></div></div></div></blockquote><div><br></div><div>This one is tricky. There are some limitations imposed by the framework. Let me think about it. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div>* Dirent prefetching for directories - done by readdir-ahead.</div></div></div></div></div></blockquote><div>The user space daemon in readdir() can populate the self-managed dcache. Future lookups can be served from this cache entirely within the kernel. What kind of workload can benefit from this?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div>* As you&#39;ve already pointed out, we can improve on our invalidation strategies.</div><div>* since page cache is already present in VFS, I don&#39;t think read-ahead/io-cache might have any benefits.</div></div></div></div></div></blockquote><div> </div><div>The framework can also bypass fuse user space daemon during data I/O (e.g., read, write) if the file is locally stored by the lower file system. This design is called pass-though I/O and has been discussed numerous times on fuse-dlevel mailing list. Recent discussion: <a href="https://lwn.net/Articles/674286/">https://lwn.net/Articles/674286/</a></div><div>Does this apply to glusterfs as well, perhaps when a file is cached by the client locally?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>As I mentioned in my previous email, <span style="font-size:12.800000190734863px">I&#39;m caching replies from fuse daemon (hashed key/value blobs) in the kernel so that for the same key (e.g., &lt;parent ino, child name&gt; in case of FUSE_LOOKUP), the reply (e.g., fuse_entry_out) is served from the kernel itself and no call is delivered to user-space. </span></div><div><br></div><div><div style="font-size:12.800000190734863px">While this may seem redundant due to entry_timeout/attr_timeout caching that already exists in FUSE, this design provides more control to the user-space daemon over when/what to invalidate. For instance, entry_timeout caching is only valid until a timeout or until the kernel removes dentry from its dcache.</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">For invalidation, fuse_lowlevel_notify_inval_ent<wbr>ry() can also remove entries from the hash table. Please refer to the figure attached in my last email. </div></div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Thanks,</div><div style="font-size:12.800000190734863px">Riya</div></div><div class="gmail-m_434855098680977718HOEnZb"><div class="gmail-m_434855098680977718h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 3, 2018 at 1:45 PM, riya khanna <span dir="ltr">&lt;<a href="mailto:riyakhanna1983@gmail.com" target="_blank">riyakhanna1983@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">I&#39;m attaching a figure that depicts the architecture of my optimized fuse framework. Kindly let me know if you have any questions.</div><div class="gmail-m_434855098680977718m_-571959774344670192HOEnZb"><div class="gmail-m_434855098680977718m_-571959774344670192h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 2, 2018 at 10:57 AM, riya khanna <span dir="ltr">&lt;<a href="mailto:riyakhanna1983@gmail.com" target="_blank">riyakhanna1983@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Amar! Please see my answers inline.<br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Mon, Apr 2, 2018 at 5:41 AM, Amar Tumballi <span dir="ltr">&lt;<a href="mailto:atumball@redhat.com" target="_blank">atumball@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Riya,<div><br></div><div>Thanks for writing to us. Some questions before we start on this. </div><div><br></div><div>* Where can we see your work of modifying the fuse module to cache the calls? Some reference would help us to provide more specific pointers. (or ask better questions).</div><div><br></div></div></blockquote></span><div>I&#39;ve created a fast path framework for FUSE, where the user space daemon can load a module and register handlers for file operations (lookup, open, r/w, etc.) that must be handled in the kernel itself without an up call to the user space. I call them fast path handlers. This design also retains the regular FUSE handlers for file system operations in upser-space (slow path). The fast path and slow path can communicate with each other over shared memory or using  syscalls to enable/invalidate caching of data structs (e.g., results of getattr, getxattr, etc.)</div><div> <br></div><div>There&#39;s a process I need to follow in order to make the code available publicly. I&#39;ve already started, but will take some time. I will try to do this asap.</div><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>* If the caching happened in fuse module, and it expects the regular arguments as the parameters, then there may not be any work required at all in glusterfs, as it works on low-level fuse api.</div><div><br></div></div></blockquote><div><br></div></span><div>The fast handlers expect same interface and args (fuse_args) as the regular user-space daemon. The fast handler code is fs-specific, therefore, must come from glusterfs. Changes are also needed in glusterfs code to communicate with the fast path for enabling/invalidating caching.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>* Also, how to invalidate caches from userspace program? because GlusterFS could be accessed from multiple clients, so it becomes an important piece to have.</div><div><br></div></div></blockquote><div><br></div></span><div>Server invalidate can trigger a system call into the fast path framework to invalidate caches. </div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>For referring at the codebase to look at integration with fuse module, please check the directory &#39;xlators/mount/fuse/src/&#39; and mostly the file &#39;fuse-bridge.c&#39;.</div><div><br></div><div>Thanks for your interest in project, would be great to collaborate on this effort, as it can enhance the performance of glusterfs in many usecases. </div></div></blockquote><div><br></div></span><div>I&#39;m still going through gluster developer documentation, but it&#39;d be helpful if you could mention what kind of use cases does the fast/slow split FUSE framework enable? i&#39;ve already applied the framework to accelerate multiple FUSE-based stackable file systems, but want the interface to be generic enough for all FUSE file systems to take advantage of it.</div><span><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Regards,</div><div>Amar</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-h5">On Mon, Apr 2, 2018 at 6:34 AM, riya khanna <span dir="ltr">&lt;<a href="mailto:riyakhanna1983@gmail.com" target="_blank">riyakhanna1983@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-h5"><div dir="ltr">Hi,<div><br></div><div><span style="font-size:12.800000190734863px">I&#39;ve modified FUSE framework to take a part of user-space daemon code and moves it into the kernel fuse driver to minimize user-kernel-user switches during file system  operations. An example would be caching getattr/getxattr/lookup/securi<wbr>ty checks etc. This design, therefore, create fast (served directly from the kernel) and a slow (regular fuse) execution paths. The fast and slow paths can also communicate with each other using shared memory.</span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">I was wondering if it is possible to accelerate glusterfs using this design. </span><span style="font-size:12.800000190734863px">What pieces could (</span><span style="font-size:12.800000190734863px">should) </span><span style="font-size:12.800000190734863px">be easily moved to kernel space? Any pointers would be highly appreciated. Thanks!</span></div><span class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-m_1997129897750036374HOEnZb"><font color="#888888"><div><br></div><div><span style="font-size:12.800000190734863px">-Riya</span></div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://lists.gluster.org/mailm<wbr>an/listinfo/gluster-devel</a><span class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_434855098680977718m_-571959774344670192m_3542945495365952127m_-1692162604354338888m_-9184113230290720190gmail-m_1997129897750036374gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Amar Tumballi (amarts)<br></div></div></div></div></div>
</font></span></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div></div></div><br></div></div></div>
</blockquote></div><br></div></div>