<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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_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="m_3311056979948520036img561324" style="max-width:99.9%" src="cid:7b3a479d-5cd6-4c3a-bc94-8c0e18d0f0c7"><br>
</p>
<p><br>
</p>
<div id="m_3311056979948520036Signature">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div id="m_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="m_3311056979948520036Signature"><div style="font-size:12pt;color:#000000;background-color:#ffffff;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:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
Best regards,</div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
Zhitao Li</div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
<div id="m_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="m_3311056979948520036LPNoLP" target="_blank">Outlook</a></div>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-users" rel="noreferrer" target="_blank">http://lists.gluster.org/<wbr>mailman/listinfo/gluster-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Amar Tumballi (amarts)<br></div></div></div></div></div>
</div></div>