<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:26:47 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-2624] Stop of ptlrpcd threads is long</title>
                <link>https://jira.whamcloud.com/browse/LU-2624</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The stop of ptlrpcd threads lasts more than one second per thread. On hardware with large number of cores this lead to a few minutes to unload ptlrpc module.&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;# lscpu | grep &quot;^CPU(s)&quot;
CPU(s):                32
# ps -ef | grep ptlrpcd
root      7301     2  0 10:58 ?        00:00:00 [ptlrpcd_rcv]
root      7302     2  0 10:58 ?        00:00:00 [ptlrpcd_0]
root      7303     2  0 10:58 ?        00:00:00 [ptlrpcd_1]
root      7304     2  0 10:58 ?        00:00:00 [ptlrpcd_2]
root      7305     2  0 10:58 ?        00:00:00 [ptlrpcd_3]
root      7306     2  0 10:58 ?        00:00:00 [ptlrpcd_4]
root      7307     2  0 10:58 ?        00:00:00 [ptlrpcd_5]
root      7308     2  0 10:58 ?        00:00:00 [ptlrpcd_6]
root      7309     2  0 10:58 ?        00:00:00 [ptlrpcd_7]
root      7310     2  0 10:58 ?        00:00:00 [ptlrpcd_8]
root      7311     2  0 10:58 ?        00:00:00 [ptlrpcd_9]
root      7312     2  0 10:58 ?        00:00:00 [ptlrpcd_10]
root      7313     2  0 10:58 ?        00:00:00 [ptlrpcd_11]
root      7314     2  0 10:58 ?        00:00:00 [ptlrpcd_12]
root      7315     2  0 10:58 ?        00:00:00 [ptlrpcd_13]
root      7316     2  0 10:58 ?        00:00:00 [ptlrpcd_14]
root      7317     2  0 10:58 ?        00:00:00 [ptlrpcd_15]
root      7318     2  0 10:58 ?        00:00:00 [ptlrpcd_16]
root      7319     2  0 10:58 ?        00:00:00 [ptlrpcd_17]
root      7320     2  0 10:58 ?        00:00:00 [ptlrpcd_18]
root      7321     2  0 10:58 ?        00:00:00 [ptlrpcd_19]
root      7322     2  0 10:58 ?        00:00:00 [ptlrpcd_20]
root      7323     2  0 10:58 ?        00:00:00 [ptlrpcd_21]
root      7324     2  0 10:58 ?        00:00:00 [ptlrpcd_22]
root      7325     2  0 10:58 ?        00:00:00 [ptlrpcd_23]
root      7326     2  0 10:58 ?        00:00:00 [ptlrpcd_24]
root      7327     2  0 10:58 ?        00:00:00 [ptlrpcd_25]
root      7328     2  0 10:58 ?        00:00:00 [ptlrpcd_26]
root      7329     2  0 10:58 ?        00:00:00 [ptlrpcd_27]
root      7330     2  0 10:58 ?        00:00:00 [ptlrpcd_28]
root      7331     2  0 10:58 ?        00:00:00 [ptlrpcd_29]
root      7332     2  0 10:58 ?        00:00:00 [ptlrpcd_30]
root      7333     2  0 10:58 ?        00:00:00 [ptlrpcd_31]
# time modprobe -r ptlrpc
real	1m7.204s
user	0m0.000s
sys	0m0.030s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

</description>
                <environment>lustre 2.1.3&lt;br/&gt;
bullxlinux 6.1 (based on redhat 6.1)&lt;br/&gt;
machine with 32 CPUs</environment>
        <key id="17186">LU-2624</key>
            <summary>Stop of ptlrpcd threads is long</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="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="pichong">Gregoire Pichon</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jan 2013 05:16:42 +0000</created>
                <updated>Sat, 23 Feb 2013 14:30:22 +0000</updated>
                            <resolved>Sat, 23 Feb 2013 14:30:22 +0000</resolved>
                                    <version>Lustre 2.2.0</version>
                    <version>Lustre 2.3.0</version>
                    <version>Lustre 2.4.0</version>
                    <version>Lustre 2.1.5</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="50532" author="pichong" created="Wed, 16 Jan 2013 05:21:11 +0000"  >&lt;p&gt;I am going to post a fix.&lt;/p&gt;

&lt;p&gt;With the fix, stop of ptlrpcd threads is dramatically reduced:&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;# time modprobe -r ptlrpc

real	0m6.675s
user	0m0.000s
sys	0m0.030s
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="50537" author="pichong" created="Wed, 16 Jan 2013 07:21:53 +0000"  >&lt;p&gt;&lt;a href=&quot;http://review.whamcloud.com/5039&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5039&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="50538" author="bfaccini" created="Wed, 16 Jan 2013 08:17:44 +0000"  >&lt;p&gt;Hello Gregoire !!&lt;br/&gt;
Thank&apos;s for the report and the fix proposal already.&lt;br/&gt;
Will review it and give you feedback soon.&lt;br/&gt;
Bye.&lt;/p&gt;</comment>
                            <comment id="50551" author="adilger" created="Wed, 16 Jan 2013 12:07:21 +0000"  >&lt;p&gt;Do you have any idea why it takes do long to stop each thread?  This might also be a sign of something else wrong (e.g. if there are structures being kept around to long and needing to be freed at the end). &lt;/p&gt;</comment>
                            <comment id="50655" author="pichong" created="Thu, 17 Jan 2013 07:29:13 +0000"  >&lt;p&gt;I don&apos;t think there is something wrong.&lt;/p&gt;

&lt;p&gt;In ptlrpcd() routine, the ptlrpcd thread loops waiting for work to do. The wait condition has a timeout of 1 second when the set is idle. When the thread is notified to stop, it performs one more loop before exiting. That explains why it lasts at least one second for each thread to stop.&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;do&lt;/span&gt; {
                struct l_wait_info lwi;
                &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; timeout;

                rc = lu_env_refill(&amp;amp;env);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc != 0) {
                        /*
                         * XXX This is very awkward situation, because
                         * execution can neither &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt; (request
                         * interpreters assume that env is set up), nor repeat
                         * the loop (as &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; potentially results in a tight
                         * loop of -ENOMEM&apos;s).
                         *
                         * Fortunately, refill only ever does something when
                         * &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; modules are loaded, i.e., early during boot up.
                         */
                        CERROR(&lt;span class=&quot;code-quote&quot;&gt;&quot;Failure to refill session: %d\n&quot;&lt;/span&gt;, rc);
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                }

                timeout = ptlrpc_set_next_timeout(set);
                lwi = LWI_TIMEOUT(cfs_time_seconds(timeout ? timeout : 1),
                                  ptlrpc_expired_set, set);

                lu_context_enter(&amp;amp;env.le_ctx);
                l_wait_event(set-&amp;gt;set_waitq,
                             ptlrpcd_check(&amp;amp;env, pc), &amp;amp;lwi);
                lu_context_exit(&amp;amp;env.le_ctx);

                /*
                 * Abort inflight rpcs &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; forced stop &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt;.
                 */
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cfs_test_bit(LIOD_STOP, &amp;amp;pc-&amp;gt;pc_flags)) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cfs_test_bit(LIOD_FORCE, &amp;amp;pc-&amp;gt;pc_flags))
                                ptlrpc_abort_set(set);
                        exit++;
                }

                /*
                 * Let&apos;s make one more loop to make sure that ptlrpcd_check()
                 * copied all raced &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; rpcs into the set so we can kill them.
                 */
        } &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; (exit &amp;lt; 2);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="50661" author="bfaccini" created="Thu, 17 Jan 2013 09:46:42 +0000"  >&lt;p&gt;Hello Gregoire, I agree with Andreas, there must be something else to explain the &amp;gt;1mn for the rmmod.&lt;/p&gt;

&lt;p&gt;BTW, each or at least groups of the ptlrpcd thread would execute in parallel on multiple Cores (depending on their scheduling policy) thus the timing you get would be the max of all execution-sets which looks too long for me ...&lt;/p&gt;

&lt;p&gt;Can you reproduce the problem and ensure that you enabled the full debug-traces before and also you delimited the rmmod timing period with BEGIN/END markers ??&lt;/p&gt;

&lt;p&gt;A ps output showing the ptlrpcd pids would be helpful too.&lt;/p&gt;</comment>
                            <comment id="50671" author="pichong" created="Thu, 17 Jan 2013 10:56:16 +0000"  >&lt;p&gt;The stop notification is sent to ptlrpcd threads one after the other. There is no concept of group of ptlrpcd thread nor execution-sets.&lt;/p&gt;

&lt;p&gt;Here are the debug traces you requested.&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;root     26857     2  0 16:44 ?        00:00:00 [ptlrpcd_rcv]
root     26858     2  0 16:44 ?        00:00:00 [ptlrpcd_0]
root     26859     2  0 16:44 ?        00:00:00 [ptlrpcd_1]
root     26860     2  0 16:44 ?        00:00:00 [ptlrpcd_2]
root     26861     2  0 16:44 ?        00:00:00 [ptlrpcd_3]
root     26862     2  0 16:44 ?        00:00:00 [ptlrpcd_4]
root     26863     2  0 16:44 ?        00:00:00 [ptlrpcd_5]
root     26864     2  0 16:44 ?        00:00:00 [ptlrpcd_6]
root     26865     2  0 16:44 ?        00:00:00 [ptlrpcd_7]
root     26866     2  0 16:44 ?        00:00:00 [ptlrpcd_8]
root     26867     2  0 16:44 ?        00:00:00 [ptlrpcd_9]
root     26868     2  0 16:44 ?        00:00:00 [ptlrpcd_10]
root     26869     2  0 16:44 ?        00:00:00 [ptlrpcd_11]
root     26870     2  0 16:44 ?        00:00:00 [ptlrpcd_12]
root     26871     2  0 16:44 ?        00:00:00 [ptlrpcd_13]
root     26872     2  0 16:44 ?        00:00:00 [ptlrpcd_14]
root     26873     2  0 16:44 ?        00:00:00 [ptlrpcd_15]
root     26874     2  0 16:44 ?        00:00:00 [ptlrpcd_16]
root     26875     2  0 16:44 ?        00:00:00 [ptlrpcd_17]
root     26876     2  0 16:44 ?        00:00:00 [ptlrpcd_18]
root     26877     2  0 16:44 ?        00:00:00 [ptlrpcd_19]
root     26878     2  0 16:44 ?        00:00:00 [ptlrpcd_20]
root     26879     2  0 16:44 ?        00:00:00 [ptlrpcd_21]
root     26880     2  0 16:44 ?        00:00:00 [ptlrpcd_22]
root     26881     2  0 16:44 ?        00:00:00 [ptlrpcd_23]
root     26882     2  0 16:44 ?        00:00:00 [ptlrpcd_24]
root     26883     2  0 16:44 ?        00:00:00 [ptlrpcd_25]
root     26884     2  0 16:44 ?        00:00:00 [ptlrpcd_26]
root     26885     2  0 16:44 ?        00:00:00 [ptlrpcd_27]
root     26886     2  0 16:44 ?        00:00:00 [ptlrpcd_28]
root     26887     2  0 16:44 ?        00:00:00 [ptlrpcd_29]
root     26888     2  0 16:44 ?        00:00:00 [ptlrpcd_30]
root     26889     2  0 16:44 ?        00:00:00 [ptlrpcd_31]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;file in attachment: lctl.dk.lu2624&lt;/p&gt;</comment>
                            <comment id="50678" author="bfaccini" created="Thu, 17 Jan 2013 11:33:25 +0000"  >&lt;p&gt;Hum sure, I was wrong assuming stop of ptlrpcds could occur in parallel ! Don&apos;t know why I thought we were ahead in the way they can operate more independently ...&lt;/p&gt;

&lt;p&gt;With &quot;execution-sets&quot; I was only referring to the different ptlrpcd scheduling policies which can either allow a single or end-up with a group of threads to execute on a single core ... But this has no importance when they execute this part of the code one at a time as you highlighted ! &lt;/p&gt;

&lt;p&gt;Thank&apos;s for the debug log.&lt;/p&gt;</comment>
                            <comment id="50889" author="bfaccini" created="Mon, 21 Jan 2013 10:07:55 +0000"  >&lt;p&gt;Ok, full debug-trace confirms that with current algorithm and depending on receipt of the wake-up signals for each thread to stop or outstanding requests, full stop of all ptlrpcd threads will take about the sum of 2s per-thread for an idle situation.&lt;/p&gt;

&lt;p&gt;So, I agree with you, to separate the asynchronous signal send to each thread and the wait on completion will parallelize speed-up the ptlrpcd stopping process.&lt;/p&gt;</comment>
                            <comment id="52930" author="pjones" created="Sat, 23 Feb 2013 14:30:22 +0000"  >&lt;p&gt;Landed for 2.4&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="12168" name="lctl.dk.lu2624" size="2466191" author="pichong" created="Thu, 17 Jan 2013 10:56:16 +0000"/>
                    </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_10040" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Epic</customfieldname>
                        <customfieldvalues>
                                        <label>ptlrpc</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzvfen:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6141</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>