<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:16:26 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-15216] improve MDT QOS space balance</title>
                <link>https://jira.whamcloud.com/browse/LU-15216</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The MDT space balance heuristics in &lt;tt&gt;lmv_locate_tgt_qos()&lt;/tt&gt; has an unstable behavior.  &lt;/p&gt;

&lt;p&gt;If the MDTs are balanced, then it returns &lt;tt&gt;-EAGAIN&lt;/tt&gt; and the normal round-robin code is in effect and working properly.  However, once the MDTs are imbalanced more than &lt;tt&gt;lq_threshold_rr&lt;/tt&gt;, then the QOS code becomes active.  It has an extra check that tries to keep subdirectory creation local to the same MDT when it is deep in the directory tree, to avoid creating too many remote directories: &lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; struct lu_tgt_desc *lmv_locate_tgt_qos(struct lmv_obd *lmv, __u32 *mdt,
                                              unsigned &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt; dir_depth)
{

        /* &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; current MDT has above-average space, within range of the QOS
         * threshold, stay on the same MDT to avoid creating needless remote
         * MDT directories. It&apos;s more likely &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; low level directories.
         */
        rand = total_avail * (256 - lmv-&amp;gt;lmv_qos.lq_threshold_rr) /
               (total_usable * 256 * (1 + dir_depth / 4));
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cur &amp;amp;&amp;amp; cur-&amp;gt;ltd_qos.ltq_avail &amp;gt;= rand) {
                tgt = cur;
                GOTO(unlock, tgt);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There are three factors that make up &quot;&lt;tt&gt;rand&lt;/tt&gt;&quot;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;tt&gt;total_avail / total_usable&lt;/tt&gt; is the average (mean) free space across all MDTs&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;(256 - lmv-&amp;gt;lmv_qos.lq_threshold_rr) / 256&lt;/tt&gt; reduces the average free space slightly (e.g. 95% by default) so the MDT is still considered &quot;balanced&quot; if within &lt;tt&gt;qos_threshold_rr&lt;/tt&gt; of the average MDT free space&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;(1 + dir_depth / 4)&lt;/tt&gt; is to keep deeper subdirectories on the same MDT as the parent&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I think the &lt;tt&gt;dir_depth&lt;/tt&gt; factor makes &quot;&lt;tt&gt;rand&lt;/tt&gt;&quot; too small (reduced by 1/2 when dir_depth &amp;gt;= 4), which results in &lt;tt&gt;ltq_avail &amp;gt; average / 2&lt;/tt&gt; and the client &lt;b&gt;always&lt;/b&gt; selects the parent MDT until it has &lt;b&gt;half&lt;/b&gt; as much free space as the other MDTs.  This factor is even stronger for subdirectories created below that level.  The &quot;(1 + dir_depth / 4)&quot; factor should only reduce &lt;tt&gt;rand&lt;/tt&gt; slightly for each increase in subdirectory depth.  For example, &lt;tt&gt;(16 / (dir_depth + 10))&lt;/tt&gt;, gives 16/10 = 160% of average at root (i.e. no preference for parent MDT unless it has 60% &lt;b&gt;more&lt;/b&gt; than average free space), 16/16 = 100% of average free space at 6 levels deep, 16/22=72% of average at 12 levels deep, and 16/32 = 50% of average at 22 levels deep).&lt;/p&gt;

&lt;p&gt;Also, rather than always returning &quot;&lt;tt&gt;tgt = cur&lt;/tt&gt;&quot; in the &quot;prefer parent&quot; case, it could return &lt;tt&gt;-EAGAIN&lt;/tt&gt; and leave it up to &lt;tt&gt;lmv_locate_tgt()&lt;/tt&gt; to decide to use round-robin or same-MDT allocation for the directory.  However, that would need to teach &lt;tt&gt;lmv_locate_tgt_rr()&lt;/tt&gt; to &lt;b&gt;skip&lt;/b&gt; MDTs with more than average free space if &lt;tt&gt;ltd_qos_is_usable()&lt;/tt&gt; is true, which is a more complex change.  Something along the lines of &quot;skip MDT N times if it has N times less free space than (most_free - average)&quot;, preferably taking &lt;tt&gt;qos_prio_free&lt;/tt&gt; into account, but this needs more thought and should be implemented in a second patch.&lt;/p&gt;</description>
                <environment></environment>
        <key id="67147">LU-15216</key>
            <summary>improve MDT QOS space balance</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="laisiyao">Lai Siyao</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Nov 2021 04:43:27 +0000</created>
                <updated>Wed, 23 Mar 2022 20:25:38 +0000</updated>
                            <resolved>Thu, 6 Jan 2022 23:18:52 +0000</resolved>
                                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="318049" author="gerrit" created="Fri, 12 Nov 2021 05:12:42 +0000"  >&lt;p&gt;&quot;Lai Siyao &amp;lt;lai.siyao@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/45544&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/45544&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15216&quot; title=&quot;improve MDT QOS space balance&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15216&quot;&gt;&lt;del&gt;LU-15216&lt;/del&gt;&lt;/a&gt; lmv: improve MDT QOS space balance&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 3a444e7f7168258c1d72dee8ce37526bf881fe0e&lt;/p&gt;</comment>
                            <comment id="321959" author="gerrit" created="Thu, 6 Jan 2022 22:02:59 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/45544/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/45544/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15216&quot; title=&quot;improve MDT QOS space balance&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15216&quot;&gt;&lt;del&gt;LU-15216&lt;/del&gt;&lt;/a&gt; lmv: improve MDT QOS space balance&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 38c4c538f53fb5f0c7f6db6d4970c491184e81a0&lt;/p&gt;</comment>
                            <comment id="321990" author="pjones" created="Thu, 6 Jan 2022 23:18:52 +0000"  >&lt;p&gt;Landed for 2.15&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="67144">LU-15213</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="67145">LU-15214</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="67146">LU-15215</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="10082">LU-9</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="58656">LU-13417</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i029rb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>