<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:25:50 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-2513] typo in shrink osc grants</title>
                <link>https://jira.whamcloud.com/browse/LU-2513</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;static int osc_shrink_grant(struct client_obd *cli)&lt;br/&gt;
{&lt;br/&gt;
        long target = (cli-&amp;gt;cl_max_rpcs_in_flight + 1) *&lt;br/&gt;
                      cli-&amp;gt;cl_max_pages_per_rpc;&lt;/p&gt;

&lt;p&gt;        client_obd_list_lock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);&lt;br/&gt;
        if (cli-&amp;gt;cl_avail_grant &amp;lt;= target)&lt;br/&gt;
                target = cli-&amp;gt;cl_max_pages_per_rpc;&lt;br/&gt;
        client_obd_list_unlock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);&lt;/p&gt;

&lt;p&gt;        return osc_shrink_grant_to_target(cli, target);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;that function looks have a typo - cl_avail_grant in bytes, but target will be in pages so &amp;lt;&amp;lt; CFS_PAGE_SHIFT looks lost.&lt;/p&gt;</description>
                <environment></environment>
        <key id="16996">LU-2513</key>
            <summary>typo in shrink osc grants</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="jhammond">John Hammond</assignee>
                                    <reporter username="shadow">Alexey Lyashkov</reporter>
                        <labels>
                            <label>LB</label>
                    </labels>
                <created>Thu, 20 Dec 2012 12:07:28 +0000</created>
                <updated>Mon, 22 Apr 2013 01:30:29 +0000</updated>
                            <resolved>Mon, 22 Apr 2013 01:30:29 +0000</resolved>
                                    <version>Lustre 2.1.0</version>
                    <version>Lustre 2.2.0</version>
                    <version>Lustre 2.3.0</version>
                    <version>Lustre 2.4.0</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="49492" author="shadow" created="Thu, 20 Dec 2012 12:20:48 +0000"  >&lt;p&gt;looks also in osc_shrink_grant_to_target&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;        client_obd_list_lock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
        /* Don&apos;t shrink &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we are already above or below the desired limit
         * We don&apos;t want to shrink below a single RPC, as that will negatively
         * impact block allocation and &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;-term performance. */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (target &amp;lt; cli-&amp;gt;cl_max_pages_per_rpc)
                target = cli-&amp;gt;cl_max_pages_per_rpc;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (target &amp;gt;= cli-&amp;gt;cl_avail_grant) {
                client_obd_list_unlock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
                RETURN(0);
        }
        client_obd_list_unlock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);

        OBD_ALLOC_PTR(body);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!body)
                RETURN(-ENOMEM);

        osc_announce_cached(cli, &amp;amp;body-&amp;gt;oa, 0);

        client_obd_list_lock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
        body-&amp;gt;oa.o_grant = cli-&amp;gt;cl_avail_grant - target;
        cli-&amp;gt;cl_avail_grant = target;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but..&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;osc_cache.c:    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (cli-&amp;gt;cl_avail_grant &amp;gt;= bytes) {
osc_cache.c:            cli-&amp;gt;cl_avail_grant    -= bytes;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;so we really in bytes..&lt;/p&gt;</comment>
                            <comment id="49544" author="shadow" created="Fri, 21 Dec 2012 08:48:27 +0000"  >&lt;p&gt;one more bug in same function&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-object&quot;&gt;int&lt;/span&gt; osc_shrink_grant_to_target(struct client_obd *cli, &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; target)
{
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;    rc = 0;
        struct ost_body     *body;
        ENTRY;

        client_obd_list_lock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
        /* Don&apos;t shrink &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we are already above or below the desired limit
         * We don&apos;t want to shrink below a single RPC, as that will negatively
         * impact block allocation and &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt;-term performance. */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (target &amp;lt; cli-&amp;gt;cl_max_pages_per_rpc)
                target = cli-&amp;gt;cl_max_pages_per_rpc;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (target &amp;gt;= cli-&amp;gt;cl_avail_grant) {
                client_obd_list_unlock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
                RETURN(0);
        }
        client_obd_list_unlock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);

        OBD_ALLOC_PTR(body);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!body)
                RETURN(-ENOMEM);

        osc_announce_cached(cli, &amp;amp;body-&amp;gt;oa, 0);

        client_obd_list_lock(&amp;amp;cli-&amp;gt;cl_loi_list_lock);
        body-&amp;gt;oa.o_grant = cli-&amp;gt;cl_avail_grant - target;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;so we have a release a lock and may sleep for any time and may have negative result of cl_avail_grant - target after it.&lt;/p&gt;

&lt;p&gt;second question - is this operation &apos;atomic&apos; over client + ost.&lt;/p&gt;</comment>
                            <comment id="49779" author="shadow" created="Sat, 29 Dec 2012 07:42:17 +0000"  >&lt;p&gt;few more bugs with grants.&lt;br/&gt;
1) wrong rounding to block size (fixed in 2.4).&lt;br/&gt;
2) &lt;br/&gt;
[  933.237133] LustreError: 29642:0:(ofd_grant.c:250:ofd_grant_space_left()) lustre-OST0000: cli lustre-OST0000_UUID/ffff8800a72809a0 left 62275584 &amp;lt; tot_grant 65467236 unstable 0 pending 0&lt;br/&gt;
Dec 28 07:45:39 rhel6-64 kernel: [  933.237133] LustreError: 29642:0:(ofd_grant.c:250:ofd_grant_space_left()) lustre-OST0000: cli lustre-OST0000_UUID/ffff8800a72809a0 left 62275584 &amp;lt; tot_grant 65467236 unstable 0 pending 0&lt;/p&gt;

&lt;p&gt;with simple test&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;[root@rhel6-64 tests]# OSTCOUNT=1 DEBUG_SIZE=400 SUBSYSTEM=&lt;span class=&quot;code-quote&quot;&gt;&quot;ost osc filter&quot;&lt;/span&gt; PTLDEBUG=-1 sh llmount.sh 
&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; i in {1..25000}; &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt;
    dd &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;=/dev/zero of=lustre/$i bs=4096 count=2
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; [ $? -ne 0 ]; then
        &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
    fi;
done
lctl dk &amp;gt; /tmp/grant.log
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;3) send up to max rpc in flight grant requests in parallel /reproduced with 2.1 but exist in 2.4/&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;82297.783585:0:5381:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 33603584 granting: 0
82297.783601:0:5373:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 33603584 granting: 0
82297.802358:0:5373:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 33546240 granting: 1048576
82297.802404:0:5381:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 33546240 granting: 1048576
82297.802757:0:5373:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 33546240 granting: 1048576
82297.829384:0:5381:0:(filter_io.c:249:filter_grant()) lustre-OST0000: cli 846bbe16-0fc2-273c-ff5f-ff1e24116f3f/ffff8800908e1438 wants: 33554432 current grant 41869312 granting: 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;with that example - client got a 2 extra grant updates.&lt;/p&gt;

&lt;p&gt;but we really don&apos;t need a have grants more then dirty cache size, because we have stick in waiting dirty space.&lt;br/&gt;
limiting a grant request don&apos;t need to be to max rpc in flight, because that is more related to dirty cache when network transfer.&lt;/p&gt;


</comment>
                            <comment id="50032" author="shadow" created="Sun, 6 Jan 2013 01:00:00 +0000"  >&lt;p&gt;Xyratex-Bug-Id: MRP-809.&lt;/p&gt;

&lt;p&gt;Peter,&lt;/p&gt;

&lt;p&gt;I have fix for it issue, and have plan to submit in short time.&lt;br/&gt;
Fix touched client side only.&lt;/p&gt;</comment>
                            <comment id="50034" author="shadow" created="Sun, 6 Jan 2013 01:44:57 +0000"  >&lt;p&gt;2.1 need additional chunk &lt;/p&gt;

&lt;p&gt;diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c&lt;br/&gt;
index bb2b8d1..5096950 100644&lt;br/&gt;
&amp;#8212; a/lustre/obdfilter/filter_io.c&lt;br/&gt;
+++ b/lustre/obdfilter/filter_io.c&lt;br/&gt;
@@ -603,7 +603,7 @@ static int filter_grant_check(struct obd_export *exp, struct obdo *oa,&lt;br/&gt;
                ungranted, fed-&amp;gt;fed_grant, fed-&amp;gt;fed_dirty);&lt;/p&gt;

&lt;p&gt;         /* Rough calc in case we don&apos;t refresh cached statfs data */&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;using = (used + ungranted + 1 ) &amp;gt;&amp;gt;&lt;br/&gt;
+        using = (used + ungranted + blocksize - 1) &amp;gt;&amp;gt;&lt;br/&gt;
                 exp-&amp;gt;exp_obd-&amp;gt;u.obt.obt_sb-&amp;gt;s_blocksize_bits;&lt;br/&gt;
         if (exp-&amp;gt;exp_obd-&amp;gt;obd_osfs.os_bavail &amp;gt; using)&lt;br/&gt;
                 exp-&amp;gt;exp_obd-&amp;gt;obd_osfs.os_bavail -= using;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="50423" author="shadow" created="Mon, 14 Jan 2013 11:17:16 +0000"  >&lt;p&gt;remote: New Changes:&lt;br/&gt;
remote:   &lt;a href=&quot;http://review.whamcloud.com/5017&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5017&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="50424" author="shadow" created="Mon, 14 Jan 2013 11:17:38 +0000"  >&lt;p&gt;if 2.1 fix need - i may submit it also.&lt;/p&gt;</comment>
                            <comment id="52759" author="adilger" created="Wed, 20 Feb 2013 13:43:47 +0000"  >&lt;p&gt;John, can you please submit a patch that only fixes the bytes-vs-pages issue independent of the &quot;number of rpcs in flight&quot; change that is blocking the current patch from landing.&lt;/p&gt;</comment>
                            <comment id="52760" author="jhammond" created="Wed, 20 Feb 2013 13:52:56 +0000"  >&lt;p&gt;Please see &lt;a href=&quot;http://review.whamcloud.com/5495&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5495&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="55228" author="jhammond" created="Mon, 1 Apr 2013 20:44:48 +0000"  >&lt;p&gt;Patch landed.&lt;/p&gt;</comment>
                            <comment id="55260" author="shadow" created="Tue, 2 Apr 2013 09:23:55 +0000"  >&lt;p&gt;Andreas, my last version have dropped an limiting a number of rpc from a patch, and i don&apos;t understand a situation why it&apos;s don&apos;t inspected and new patch created?&lt;br/&gt;
It&apos;s hard to inspect a existent patch instead of create own?&lt;/p&gt;

&lt;p&gt;I really don&apos;t understand...&lt;/p&gt;</comment>
                            <comment id="55442" author="adilger" created="Wed, 3 Apr 2013 22:27:59 +0000"  >&lt;p&gt;Shadow, you submitted the original patch on Jan 11 and I inspected it on Jan 17, then Jinshan inspected it again on feb 11.   I wanted to make sure that at least the basic fix was landed, so a month after not hearing from you (Feb 20) I asked John to submit the basic fix without changing the whole grant protocol. In cases like this it is easier to separate the basic fix (incompatible units for grant variables) from a much more major change that is controversial.  You didn&apos;t refresh the original the patch until March 20. &lt;/p&gt;

&lt;p&gt;I agree that John should have resubmitted his patch using the same Change-Id as your original patch, since this makes it a lot easier to reinspect and compare the two patches.  That would also have made it more clear to you that there was a new version of your fix . Sorry for the confusion. &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|hzve33:</customfieldvalue>

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