<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Dear Amar,&nbsp;</p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">Thanks very much&nbsp;for your kind help!</span></p>
<p><span style="font-size: 12pt;">&nbsp;</span><br>
</p>
<p><span style="font-size: 12pt;">I have seen the patch you submit.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p>I disable the check and do regression test locally. It indeed <b>brings a bug in &quot;tests/basic/afr/quorum.t&quot;</b>(for tests/ec/, there exists failure but it is hard to reappear the failure).</p>
<p><br>
</p>
<p>For quorum test, it fails &nbsp;in line_no 36. The case&nbsp;is that for a volume with replica 2, a brick is killed and quorum-reads is on, quorum-type is fixed. Stat on the root_dir will fail because of quorum check(afr/afr-read-txn.c).&nbsp;However, lookup will succeed
 without quorum&nbsp;check. This is what I have got.</p>
<p>So the solution maybe more complex than removing the nodeid==1 check directly.</p>
<p><br>
</p>
<p>Thank you!</p>
<div id="Signature">
<div style="font-size:12pt; color:#000000; background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif">
&nbsp;</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>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Amar Tumballi &lt;atumball@redhat.com&gt;<br>
<b>Sent:</b> Friday, March 24, 2017 9:13:35 PM<br>
<b>To:</b> Zhitao Li<br>
<b>Cc:</b> Niels de Vos; Poornima Gurusiddaiah; Gluster Devel; gluster-users@gluster.org; Zhitao Li; Zhitao Li<br>
<b>Subject:</b> Re: Could we not always call lookup for root_dir in fuse_getattr to improve performance?</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div>
<div>Went through the code base again. Yes, as you said, we can get rid of fuse_getattr() not checking nodeid==1 path.<br>
<br>
</div>
Patch here:&nbsp; <a href="https://review.gluster.org/16944">https://review.gluster.org/16944</a><br>
<br>
</div>
-Amar<br>
<div><br>
<br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Mar 24, 2017 at 2:57 AM, Zhitao Li <span dir="ltr">
&lt;<a href="mailto:zhitaoli1201@outlook.com" target="_blank">zhitaoli1201@outlook.com</a>&gt;</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_1011345600268860472divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Hello, everyone!</p>
<p><br>
</p>
<p>I am now optimizing the performance of &quot;ls&quot;.&nbsp;<span style="font-size:12pt">When there are many little files directly&nbsp;</span><span style="font-size:12pt">in mount point(root dir of glusterfs</span><span style="font-size:12pt">)</span><span style="font-size:12pt">,
 I find that fuse_getattr takes near half time of total&nbsp;</span><span style="font-size:12pt">&quot;ls&quot;. Strictly, the nodeid==1 check in fuse_getattr will call look operation instead of stat, and lookup will always miss the md-cache, so it will do real lookup and
 cost about 3ms a time&nbsp;in my case.&nbsp;</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p>I doubt whether the special check of nodeid==1 is necessary. I disable the check, &nbsp;it works normal for ls. However, in the &quot;tests&quot; of gluster, it fails(quorum.t). In that case, lookup in root_dir&nbsp;is essential.</p>
<p><br>
</p>
<p>Up to now, we know that lookup bring high cost in fuse_getattr and it is essential in some case. Could anyone give some advice to improve fuse_getattr(lookup in root_dir)&nbsp;without bringing bugs?&nbsp;</p>
<p><br>
</p>
<p>I have been trying to deal &nbsp;with this for many days. Your help is greatly in need. &nbsp;</p>
<p><br>
</p>
<div id="m_1011345600268860472Signature">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
&nbsp;</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>
</div>
</div>
</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>
</body>
</html>