<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:12:34 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-7861] MDS Contention during unlinks due to llog spinlock</title>
                <link>https://jira.whamcloud.com/browse/LU-7861</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;We see intermittent periods of interactive &quot;slowness&quot; on our production systems.  Looking on the MDS, load can go quite high.  Running &lt;em&gt;perf&lt;/em&gt; we see that &lt;em&gt;osp_sync_add_rec&lt;/em&gt; is chewing a lot of time in a spin_lock.  I believe this is serially adding the unlink records to the llog so the OST objects will be removed.&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;-&#8194;&#8194; 29.60%&#8194;&#8194;&#8194;&#8194;29.60%&#8194;&#8194;[kernel]&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194; [k] _spin_lock&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#9618;
&#8194;&#8194; - _spin_lock&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;- 77.51% osp_sync_add_rec&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194; osp_sync_add&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;+ 7.79% task_rq_lock&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194; &#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;+ 6.68% try_to_wake_up&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194; &#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;+ 1.32% osp_statfs&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194; &#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;+ 1.26% kmem_cache_free&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;&#9618;
&#8194;&#8194;&#8194;&#8194;&#8194;&#8194;+ 1.12% cfs_percpt_lock
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I used jobstats to confirm that we had at least two jobs doing a significant number of unlinks at the time.  When multiple MDS threads attempt to do unlinks they serialize, but they spin and block the CPUs in the meantime.&lt;/p&gt;

&lt;p&gt;I believe the following code is responsible:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;osp_sync.c:421&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;                spin_lock(&amp;amp;d-&amp;gt;opd_syn_lock);
                d-&amp;gt;opd_syn_changes++;
                spin_unlock(&amp;amp;d-&amp;gt;opd_syn_lock);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;How can we improve this situation:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Is the spin_lock here just to protect &lt;em&gt;opd_syn_changes&lt;/em&gt; (so it could be changed to an atomic) or does it enforce additional synchronization?  Would a mutex be appropriate here, or would the context switches kill us in a different way?&lt;/li&gt;
	&lt;li&gt;Does it make sense to support multiple llogs per device and hash objects to the different llogs so they can be appended to in parallel?  Are there assumptions of ordering for llogs?&lt;/li&gt;
	&lt;li&gt;Something else?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>2.5.5-g1241c21-CHANGED-2.6.32-573.12.1.el6.atlas.x86_64&lt;br/&gt;
</environment>
        <key id="35250">LU-7861</key>
            <summary>MDS Contention during unlinks due to llog spinlock</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</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="bzzz">Alex Zhuravlev</assignee>
                                    <reporter username="ezell">Matt Ezell</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Mar 2016 16:45:07 +0000</created>
                <updated>Thu, 9 Feb 2017 17:08:29 +0000</updated>
                            <resolved>Wed, 22 Jun 2016 15:18:41 +0000</resolved>
                                    <version>Lustre 2.5.5</version>
                                    <fixVersion>Lustre 2.9.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>11</watches>
                                                                            <comments>
                            <comment id="145158" author="simmonsja" created="Thu, 10 Mar 2016 17:39:54 +0000"  >&lt;p&gt;Looking at the use of opd_syn_changes I noticed in several places it is not protected by opd_syn_lock.&lt;/p&gt;</comment>
                            <comment id="145162" author="jgmitter" created="Thu, 10 Mar 2016 18:02:50 +0000"  >&lt;p&gt;Hi Alex,&lt;br/&gt;
Can you have a look at this issue?&lt;br/&gt;
Thanks.&lt;br/&gt;
Joe&lt;/p&gt;</comment>
                            <comment id="145661" author="bzzz" created="Tue, 15 Mar 2016 19:35:41 +0000"  >&lt;p&gt;i&apos;m trying to reproduce the case. also, I don&apos;t think osp_sync_add_rec() is the issue itself, I&apos;d rather suspect osp_sync_inflight_conflict() .. &lt;/p&gt;</comment>
                            <comment id="145782" author="ezell" created="Wed, 16 Mar 2016 15:12:09 +0000"  >&lt;p&gt;Hi Alex-&lt;/p&gt;

&lt;p&gt;b2_5_fe doesn&apos;t have osp_sync_inflight_conflict().  Let us know if there is any additional information we can provide to help.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
~Matt&lt;/p&gt;</comment>
                            <comment id="147241" author="bzzz" created="Tue, 29 Mar 2016 18:59:02 +0000"  >&lt;p&gt;well, I can&apos;t reproduce that locally, but I&apos;ve got a proto patch which is in testing now.&lt;/p&gt;</comment>
                            <comment id="147331" author="gerrit" created="Wed, 30 Mar 2016 13:07:39 +0000"  >&lt;p&gt;Alex Zhuravlev (alexey.zhuravlev@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/19211&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/19211&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7861&quot; title=&quot;MDS Contention during unlinks due to llog spinlock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7861&quot;&gt;&lt;del&gt;LU-7861&lt;/del&gt;&lt;/a&gt; osp: replace the hot spinlock with atomic trackers&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e49e195abf46258a8e8c9f6ff194f21917f52a19&lt;/p&gt;</comment>
                            <comment id="150021" author="bzzz" created="Mon, 25 Apr 2016 14:24:52 +0000"  >&lt;p&gt;Matt, can you tell how did you measure (or noticed) that slowness? the patch above should improve this specific case as there will be less contention on that lock, but it&apos;d be great to have a reproducer. my understanding is that you were running few jobs, then two jobs were doing lots of unlinks concurrently (many clients involved), right? then some jobs doing something different (open/create, ls, stat?) were getting noticable higher latency?&lt;br/&gt;
notice that massive unlinks by themselves put significant load on MDS usually - many syncrhonous disk reads, llog records, etc.&lt;br/&gt;
I&apos;m not saying it&apos;s impossible to improve, but at the moment I can&apos;t suggest how much the patch can improve the case.&lt;/p&gt;</comment>
                            <comment id="150219" author="ezell" created="Tue, 26 Apr 2016 15:11:16 +0000"  >&lt;p&gt;Your description of the situation is accurate.  I would guess this would be hard to reproduce on a small system.  With 2.5, you only get a single metadata-modifying RPC per client.  You might want to either do multiple mounts per client, set fail_loc=0x804, or try a newer server that supports &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5319&quot; title=&quot;Support multiple slots per client in last_rcvd file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5319&quot;&gt;&lt;del&gt;LU-5319&lt;/del&gt;&lt;/a&gt; (though it&apos;s possible that other changes make this less noticeable in 2.8 servers).  My guess is that when you have many MDT threads servicing unlink requests in parallel, you get into a situation where most of the cores on the MDS are spinning on the same lock and starving the other MDT threads from running.  If most of the MDT threads get filled with unlink requests that end up being blocked, you may also run low on idle MDT threads so other requests (stat, readdir, for example) end up waiting (latency) for a thread to service it.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure we have a good reproducer, since we observed this due to user behavior in production.  I would expect that a parallel mdtest (especially if the files are pre-created and you just use -r) would show this.&lt;/p&gt;</comment>
                            <comment id="156426" author="gerrit" created="Wed, 22 Jun 2016 02:54:16 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/19211/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/19211/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7861&quot; title=&quot;MDS Contention during unlinks due to llog spinlock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7861&quot;&gt;&lt;del&gt;LU-7861&lt;/del&gt;&lt;/a&gt; osp: replace the hot spinlock with atomic trackers&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 5908965847d5535fc5def6621922e5ed00051e46&lt;/p&gt;</comment>
                            <comment id="156502" author="jgmitter" created="Wed, 22 Jun 2016 15:18:41 +0000"  >&lt;p&gt;Patch has landed to master for 2.9.0&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </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_10490" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 29 Apr 2016 16:45:07 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzy42n:</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>
                                                                                                                        <customfield id="customfield_10493" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 10 Mar 2016 16:45:07 +0000</customfieldvalue>

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