<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:02:05 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-13533] Disable lazy_itable_init</title>
                <link>https://jira.whamcloud.com/browse/LU-13533</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;lazyinit gets more than 24H on typical OST installation and produces writes inside read. &#160;This influences to benchmark tests that are usually executed just after cluster installation is complete.&#160;&lt;/p&gt;

&lt;p&gt;Testing shows, disabling that feature adds ~30 sec to formating OST drive so that is not a noticeable time during install.&lt;/p&gt;</description>
                <environment></environment>
        <key id="59089">LU-13533</key>
            <summary>Disable lazy_itable_init</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</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="artem_blagodarenko">Artem Blagodarenko</assignee>
                                    <reporter username="artem_blagodarenko">Artem Blagodarenko</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Thu, 7 May 2020 17:32:34 +0000</created>
                <updated>Tue, 15 Feb 2022 15:42:08 +0000</updated>
                            <resolved>Tue, 1 Sep 2020 04:57:15 +0000</resolved>
                                                    <fixVersion>Lustre 2.14.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="269583" author="gerrit" created="Thu, 7 May 2020 17:43:55 +0000"  >&lt;p&gt;Artem Blagodarenko (c17828@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/38534&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38534&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13533&quot; title=&quot;Disable lazy_itable_init&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13533&quot;&gt;&lt;del&gt;LU-13533&lt;/del&gt;&lt;/a&gt; utils: ext4lazyinit should be disabled&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 35524f6c2c2fea4f20d8fda4ddfdf2f94dfd1253&lt;/p&gt;</comment>
                            <comment id="278445" author="gerrit" created="Tue, 1 Sep 2020 03:43:12 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/38534/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38534/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13533&quot; title=&quot;Disable lazy_itable_init&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13533&quot;&gt;&lt;del&gt;LU-13533&lt;/del&gt;&lt;/a&gt; utils: ext4lazyinit should be disabled&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 701cc249594eae08f6e762eff74183e768c2cee3&lt;/p&gt;</comment>
                            <comment id="278468" author="pjones" created="Tue, 1 Sep 2020 04:57:15 +0000"  >&lt;p&gt;Landed for 2.14&lt;/p&gt;</comment>
                            <comment id="291923" author="adilger" created="Sat, 13 Feb 2021 00:58:38 +0000"  >&lt;p&gt;Artem, did you ever look into why the &lt;tt&gt;lazy_itable_init&lt;/tt&gt; was taking so long in the kernel?  Since &lt;tt&gt;mke2fs&lt;/tt&gt; is also calling the same underlying &lt;tt&gt;blkdev_issue_zeroout()}] code (via {{fallocate(FALLOC_FL_ZERO_RANGE)&lt;/tt&gt; on the block device) as the kernel (via &lt;tt&gt;ext4_issue_zeroout-&amp;gt;sb_issue_zeroout()&lt;/tt&gt;), it must be more of a scheduling issue from the &lt;tt&gt;ext4_lazyinit_thread&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;It looks like the default is to schedule the next group to start 10x the time it took to zero out the current group (default &lt;tt&gt;s_li_wait_mult = EXT4_DEF_LI_WAIT_MULT = 10&lt;/tt&gt;), so at best it could use 10% of the available disk bandwidth.  It is possible to use &quot;&lt;tt&gt;-o lazy_itable_init=N&lt;/tt&gt;&quot; to tune this delay, although it looks like setting &lt;tt&gt;s_li_wait_mult=0&lt;/tt&gt; or if the writes complete in less than 1 jiffie (maybe with flash) will cause all of the writes to be synchronous:&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;
                timeout = jiffies;
                ret = ext4_init_inode_table(sb, group,
                                            elr-&amp;gt;lr_timeout ? 0 : 1);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (elr-&amp;gt;lr_timeout == 0) {
                        timeout = (jiffies - timeout) *
                                  elr-&amp;gt;lr_sbi-&amp;gt;s_li_wait_mult;
                        elr-&amp;gt;lr_timeout = timeout;
                }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;At a minimum, the above code should set &lt;tt&gt;elr-&amp;gt;lr_timeout = timeout ?: 1&lt;/tt&gt; so that it doesn&apos;t do all writes synchronously for fast storage.&lt;/p&gt;

&lt;p&gt;A better solution would be to schedule the inode table zeroing as fast as possible after mounting, and only throttle it down when the filesystem is &quot;busy&quot; with user requests.  This could be done by using &quot;trylock&quot; variants for &lt;tt&gt;alloc_sem&lt;/tt&gt;, etc. to detect if there is contention, or by having a simple percpu counter in some of the main incoming codepaths (e.g. lookup, read, write) and checking if this is changing between calls to detect if there is userspace activity.  I&apos;d thought maybe using the superblock &lt;tt&gt;s_kbytes_written&lt;/tt&gt; counter for this, but it is only updated at unmount time, and from the underlying block device, so that would be affected by the zeroout itself.&lt;/p&gt;</comment>
                            <comment id="292013" author="artem_blagodarenko" created="Mon, 15 Feb 2021 16:53:59 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=adilger&quot; class=&quot;user-hover&quot; rel=&quot;adilger&quot;&gt;adilger&lt;/a&gt; do you have plans to re-enable lazy_itable_init for Lustre?&lt;/p&gt;</comment>
                            <comment id="292014" author="adilger" created="Mon, 15 Feb 2021 16:56:55 +0000"  >&lt;p&gt;I&apos;ve been thinking bout using the same mechanism for doing background TRIM operations, instead of the current &quot;&lt;tt&gt;-o discard&lt;/tt&gt;&quot; code, so I would like to know what is wrong with the current code.&#160;&lt;/p&gt;</comment>
                            <comment id="315181" author="haaknci" created="Mon, 11 Oct 2021 02:42:24 +0000"  >&lt;p&gt;While it might only add a few second to an OST it means our MDT&apos;s are going to take over 2 hrs EACH to format. We have like 8..... makes formatting MDT&apos;s a multi-day affair. &lt;/p&gt;

&lt;p&gt;Can we re-look at this?&lt;/p&gt;</comment>
                            <comment id="315189" author="adilger" created="Mon, 11 Oct 2021 05:52:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=haaknci&quot; class=&quot;user-hover&quot; rel=&quot;haaknci&quot;&gt;haaknci&lt;/a&gt;, you can still use &quot;&lt;tt&gt;--mkfsoptions=&apos;-E lazy_itable_init&apos;&lt;/tt&gt;&quot; when formatting your MDTs.  This is just a change to the default options because we had a number of complaints that performance after formatting the filesystem was slow. &lt;/p&gt;</comment>
                            <comment id="315192" author="haaknci" created="Mon, 11 Oct 2021 07:10:27 +0000"  >&lt;p&gt;Not on 2.14.0 you can&apos;t. It has a bug. I&apos;ve cherry picked the 2.15 fix. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="64683">LU-14767</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="36938">LU-8144</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|i00zrz:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>