<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:02:17 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-6676] Excessive blocking ast RPC for LDLM locks in waiting list</title>
                <link>https://jira.whamcloud.com/browse/LU-6676</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In current implementation of LDLM lock, if a lock is in waiting list and blocks a newly enqueued lock, the waiting lock will be added into work_list and blocking AST will be sent against this lock.&lt;/p&gt;

&lt;p&gt;This is a waste of effort because the lock is not granted yet, usually the client holds a reader/writer counter so blocking AST can&apos;t do anything to the lock;&lt;/p&gt;

&lt;p&gt;Actually the server doesn&apos;t need to send the blocking AST RPC for waiting locks, instead it can just set LDLM_FL_AST_SENT flag and this flag will be piggied back by completion AST later.&lt;/p&gt;</description>
                <environment></environment>
        <key id="30466">LU-6676</key>
            <summary>Excessive blocking ast RPC for LDLM locks in waiting list</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="jay">Jinshan Xiong</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Jun 2015 17:06:47 +0000</created>
                <updated>Fri, 10 Jul 2015 18:47:06 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="117183" author="green" created="Tue, 2 Jun 2015 18:07:33 +0000"  >&lt;p&gt;Do we really send blocking AST, though?&lt;/p&gt;

&lt;p&gt;In ldlm_Server_blockingast we have this bit:&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;        lock_res_and_lock(lock);
        if (lock-&amp;gt;l_granted_mode != lock-&amp;gt;l_req_mode) {
                /* this blocking AST will be communicated as part of the
                 * completion AST instead */
                unlock_res_and_lock(lock);

                ptlrpc_req_finished(req);
                LDLM_DEBUG(lock, &quot;lock not granted, not sending blocking AST&quot;);
                RETURN(0);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So nothing is sent.&lt;/p&gt;</comment>
                            <comment id="117203" author="jay" created="Tue, 2 Jun 2015 20:09:14 +0000"  >&lt;p&gt;I missed this part. But again this is not good because those locks in waiting list don&apos;t have to be added into work_list in the first place.&lt;/p&gt;</comment>
                            <comment id="117275" author="green" created="Wed, 3 Jun 2015 14:43:19 +0000"  >&lt;p&gt;Which waiting list do you mean?&lt;br/&gt;
The resource waiting list? we absolutely must add the locks there because that&apos;s how we know to grant them once the lock that blocks them goes away.&lt;/p&gt;

&lt;p&gt;The waiting list for timer to evict the clients? we don&apos;t add there until the lock is actually granted.&lt;/p&gt;

&lt;p&gt;Can you please elaborate?&lt;/p&gt;</comment>
                            <comment id="117291" author="jay" created="Wed, 3 Jun 2015 15:38:39 +0000"  >&lt;p&gt;For example, for extent lock, in ldlm_process_extent_lock():&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;ldlm_process_extent_lock() {
        ...
        rc2 = ldlm_extent_compat_queue(&amp;amp;res-&amp;gt;lr_waiting, lock, flags, err,
                                       &amp;amp;rpc_list, &amp;amp;contended_locks);
        ...
}

ldlm_extent_compat_queue()
{
                        ...
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!work_list)
                                RETURN(0);

                        &lt;span class=&quot;code-comment&quot;&gt;/* don&apos;t count conflicting glimpse locks */&lt;/span&gt;
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lock-&amp;gt;l_req_mode == LCK_PR &amp;amp;&amp;amp;
                            lock-&amp;gt;l_policy_data.l_extent.start == 0 &amp;amp;&amp;amp;
                            lock-&amp;gt;l_policy_data.l_extent.end == OBD_OBJECT_EOF)
                                check_contention = 0;

                        *contended_locks += check_contention;

                        compat = 0;
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lock-&amp;gt;l_blocking_ast)
                                ldlm_add_ast_work_item(lock, req, work_list);
                        ...
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If the lock is in the waiting list, can we assume that the CP AST is not sent for this lock? If that is the case, we don&apos;t need to add the lock into the @work_list, instead we can set the AST_SENT bit directly because we know there exists a CP AST down the road.&lt;/p&gt;

&lt;p&gt;And in ldlm_server_completion_ast():&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-comment&quot;&gt;/* We only send real blocking ASTs after the lock is granted */&lt;/span&gt;
        lock_res_and_lock(lock);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ldlm_is_ast_sent(lock)) {
                body-&amp;gt;lock_flags |= ldlm_flags_to_wire(LDLM_FL_AST_SENT);
                &lt;span class=&quot;code-comment&quot;&gt;/* Copy AST flags like LDLM_FL_DISCARD_DATA. */&lt;/span&gt;
                body-&amp;gt;lock_flags |= ldlm_flags_to_wire(lock-&amp;gt;l_flags &amp;amp;
                                                       LDLM_FL_AST_MASK);
        ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If it has bit AST_SENT, it will be brought to client, so that client will have CP_PENDING set correspondingly.&lt;/p&gt;</comment>
                    </comments>
                    <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|hzxepj:</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>