<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 19, 2017 at 2:28 AM, Zhitao Li <span dir="ltr"><<a href="mailto:zhitaoli1201@outlook.com" target="_blank">zhitaoli1201@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_-5008627170587470459divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif" dir="ltr">
<p>Hello, Amar, </p>
<p>Thanks for your kind help. </p>
<p>Could you tell me why a lookup instead of a stat should be applied if nodeid==1 in fuse_getattr?</p><span class="gmail-">
<p><br></p></span></div></div></blockquote><div>Looks like that part of the code is introduced in very first commit (git show d5910898) and is not revisited in a long time. <br>If there are no crashes you see by removing it, i recommend you submit a patch, it should be taken in. Because I see that inode resolution should get the proper inode for (nodeid == 1) case aslo. <br><br>There was a bug in fuse where for root inode there used to be no 'lookup' coming. It was assumed to be present during the mount. We did fix it by calling the fuse_root_lookup() during init (from the notify()) itself. So, this part of the code can be taken out.<br></div><div><br></div><div>Regards,<br></div><div>Amar<br></div><div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-5008627170587470459divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif" dir="ltr"><span class="gmail-"><div id="gmail-m_-5008627170587470459Signature">
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
Best regards,</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
Zhitao Li</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
</div>
<div id="gmail-m_-5008627170587470459divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
Sent from <a href="http://aka.ms/weboutlook" id="gmail-m_-5008627170587470459LPNoLP" target="_blank">Outlook</a></div>
</div>
</span></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-5008627170587470459divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Amar Tumballi <<a href="mailto:atumball@redhat.com" target="_blank">atumball@redhat.com</a>><br>
<b>Sent:</b> Saturday, March 18, 2017 11:23:17 PM<br>
<b>To:</b> Zhitao Li<br>
<b>Cc:</b> <a href="mailto:gluster-users@gluster.org" target="_blank">gluster-users@gluster.org</a>; Zhitao Li; <a href="mailto:1318078301@qq.com" target="_blank">1318078301@qq.com</a><br>
<b>Subject:</b> Re: [Gluster-users] Why nodeid==1 need to be checked and dealt with specially in "fuse-bridge.c"?</font>
<div> </div>
</div><div><div class="gmail-h5">
<div>
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Mar 15, 2017 at 9:17 PM, Zhitao Li <span dir="ltr">
<<a href="mailto:zhitaoli1201@outlook.com" target="_blank">zhitaoli1201@outlook.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-5008627170587470459m_3311056979948520036divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols">
<p>Hello, everyone,</p>
<p><br>
</p>
<p>I have been trying to optimize <b>"ls" performance</b> for Glusterfs recently. <span style="font-size:12pt">My volume is disperse(48 bricks with redundancy 16), and I mount it with fuse. </span><span style="font-size:12pt">I create 10000 little files in
mount point. Then I execute "ls" command. In my cluster, it takes about 3 seconds.</span></p>
<p>I have a question about <b>fuse_getattr </b>function in "fuse-bridge.c" .<b> Why need we check whether nodeid is equal to 1?</b> , which means it is the mount point. It is hard for me to get its meaning.</p>
<p>(In my case, I find the operation of fuse_getattr takes neer half time for "ls", that is why I want to know what the check means. )</p>
<p><br>
</p>
<p><img size="71684" id="gmail-m_-5008627170587470459m_3311056979948520036img561324" style="max-width: 99.9%;" src="cid:7b3a479d-5cd6-4c3a-bc94-8c0e18d0f0c7"><br>
</p>
<p><br>
</p>
<div id="gmail-m_-5008627170587470459m_3311056979948520036Signature">
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
<p style="font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols;font-size:16px">
I try to disable the special check, and then test "ls". It works normally and have a speedup 2x(about 1.3s without check). The reason is that in my case, "lookup" cost is much higher than "stat". Without the special check, getattr goes into "stat" instead of
"lookup".</p>
<p style="font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols;font-size:16px">
<br>
</p>
<p style="font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols;font-size:16px">
Could you tell me the meaning of the special check for "nodeid == 1"?</p>
</div>
</div>
</div>
</div>
</blockquote>
<div>glusterfs passes 'nodeid' as pointer of inode_t for an entry in all the cases. But in case of root (which is inode number 1, and nodeid 1), we can't pass inode pointer value, but needs to override that part of the code to send 1 instead of pointer. Hence
a separate fuse_root_lookup_cbk() function.<br>
<br>
</div>
<div>Regards,<br>
</div>
<div>Amar<br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-5008627170587470459m_3311056979948520036divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols">
<div id="gmail-m_-5008627170587470459m_3311056979948520036Signature">
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
<p style="font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols;font-size:16px">
I would appreciate it if anyone could give some tips . Thank you!</p>
<div><br>
</div>
</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
Best regards,</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
Zhitao Li</div>
<div style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif">
</div>
<div id="gmail-m_-5008627170587470459m_3311056979948520036divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:calibri,arial,helvetica,sans-serif,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols,"apple color emoji","segoe ui emoji",notocoloremoji,"segoe ui symbol","android emoji",emojisymbols">
Sent from <a href="http://aka.ms/weboutlook" id="gmail-m_-5008627170587470459m_3311056979948520036LPNoLP" target="_blank">
Outlook</a></div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org" target="_blank">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/mailm<wbr>an/listinfo/gluster-users</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div class="gmail-m_-5008627170587470459gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Amar Tumballi (amarts)<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Amar Tumballi (amarts)<br></div></div></div></div></div>
</div></div>