<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:16:25 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-15214] improve MDT QOS space balance</title>
                <link>https://jira.whamcloud.com/browse/LU-15214</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 (e.g. (16 / (dir_depth/2 + 13) (16/13 = 123% of average at root (i.e. no preference for parent unless it has 23% &lt;b&gt;more&lt;/b&gt; than average free space, 16/16 = 100% of average free space at 6 levels deep, and 16/32 = 50% of average at 38 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 should 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 should be used.  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;, but this needs more thought.&lt;/p&gt;

&lt;p&gt;I think the &quot;&lt;tt&gt;(1 + dir_depth / 4)&lt;/tt&gt;&quot; factor should only reduces &lt;tt&gt;rand&lt;/tt&gt; slightly for each increase in depth (e.g. &lt;tt&gt;(16 / (dir_depth + 16)&lt;/tt&gt; (16/20 = 75% of average at 4 levels deep, and 16/32 = 50% of average at 16 levels deep).&lt;/p&gt;

&lt;p&gt;I also wonder if, rather than always returning &lt;tt&gt;tgt = cur&lt;/tt&gt; in this case, it should return &lt;tt&gt;-EAGAIN&lt;/tt&gt; and leave it up to the caller to decide if round-robin or same-MDT allocation should be used?&lt;/p&gt;</description>
                <environment></environment>
        <key id="67145">LU-15214</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="3">Duplicate</resolution>
                                        <assignee username="adilger">Andreas Dilger</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Fri, 12 Nov 2021 04:35:30 +0000</created>
                <updated>Fri, 12 Nov 2021 04:45:33 +0000</updated>
                            <resolved>Fri, 12 Nov 2021 04:45:09 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                            <comments>
                            <comment id="318044" author="adilger" created="Fri, 12 Nov 2021 04:45:03 +0000"  >&lt;p&gt;Opened duplicate tickets.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="67147">LU-15216</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|i029qv:</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>